Skip to content

imagecache: clarify pull retry backoff comments - #1425

Merged
igooch merged 1 commit into
agent-substrate:mainfrom
dberkov:imagecache-backoff-review-followups
Sep 3, 2026
Merged

imagecache: clarify pull retry backoff comments#1425
igooch merged 1 commit into
agent-substrate:mainfrom
dberkov:imagecache-backoff-review-followups

Conversation

@dberkov

Copy link
Copy Markdown
Collaborator

Summary

Comment-only follow-ups to the review comments on #1419 (#1419 (review)):

  • Stale identifier (comment): the retry test's doc comment still referenced pullRetryBackoff, which that PR split into dedicatedRegistryBackoff and sharedRegistryBackoff. It now points at the per-registry backoff picked by retryBackoffFor.
  • Unreachable docker.io entry (comment): kept the entry (harmless, and a lookup by the canonical name should classify the same way), but the map comment now states plainly that production lookups only ever see index.docker.io because name.ParseReference normalizes docker.io and bare refs before retryBackoffFor runs.
  • Backoff accumulation vs. deadlines (comment): confirmed the concern is bounded and documented why. The backoff is per request, so a multi-layer pull under a sustained throttle can accumulate well past one request's ~14s worst case — but every request carries the caller ctx (remote.WithContext), go-containerregistry's retry transport never retries a context error, so retrying overshoots a deadline by at most one backoff sleep. Production pulls run under the Run/Restore RPC ctx, which ateapi caps at maxRPCDeadline (10m); the router's parking budget deliberately defers to that server-side deadline. A throttled shared-registry pull therefore surfaces as the RPC's deadline error, not a hang.

Test plan

Comment-only change: go test ./internal/imagecache/, go vet, and gofmt all pass.

🤖 Generated with Claude Code

Follow-ups from review of the per-registry backoff split:

- Replace a stale reference to pullRetryBackoff in the retry test's doc
  comment; that var was split into dedicatedRegistryBackoff and
  sharedRegistryBackoff.
- Note on the sharedRegistries map that production lookups only ever see
  index.docker.io (name.ParseReference normalizes docker.io and bare
  refs), and that the docker.io entry is kept so a lookup by the
  canonical name classifies the same way.
- Document why per-request backoff accumulation cannot turn a sustained
  shared-registry throttle into a hang: every request carries the caller
  ctx, a canceled ctx is never retried (at most one backoff sleep of
  overshoot), and production pulls run under the Run/Restore RPC ctx,
  which ateapi caps at its server-wide max RPC deadline.

@igooch igooch left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@igooch
igooch merged commit 530869e into agent-substrate:main Sep 3, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants