GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — engine: retry image pulls and resolves after a network error by sipsma · Pull Request #14978 · dagger/dagger

Conversation

@sipsma

@sipsma sipsma commented Oct 30, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Since #11856 moved image pulls onto the new resolver, a pull makes each registry request once. A network error partway through now fails the whole Container.from, where the old pull path retried. This affects anyone pulling from a registry that occasionally drops connections. In our CI it is behind every recent TestPlatform/TestWindows failure: mcr.microsoft.com resets connections now and then.

This PR retries both requests that can hit this, with BuildKit's existing retry handler, the one the pre-#11856 pull path used. It retries connection resets, EOFs, temporary network errors and 5xx responses, up to 4 attempts, waiting 1, 2 and 4 s.

  • Layer and blob downloads (Resolver.Pull): a reset partway through a layer failed with failed to copy: ... connection reset by peer. containerd's reader only reconnects after an unexpected EOF. A retried download resumes where it stopped. Three of the four recent TestWindows failures were this.
  • Resolving the manifest (resolveRemoteRootDescriptor, which resolving an image's config, resolving its digest and pulling all go through): containerd retries some error statuses (401, 408, 429, a 5xx), but no network errors. The fourth failure was failed to do request: Head ".../manifests/ltsc2022": net/http: TLS handshake timeout.

A missing image, a refused login and other 4xx answers still fail at once. Pulls that succeed take the same path as before. A pull that keeps hitting network errors now takes up to about 7 s longer to fail.

Tests, in engine/server/resolver/pull_metadata_test.go, run by CI's test-split/test-packages:

  • A registry that sends half a layer, resets the connection, then serves the resumed range request. Without the fix the test fails with CI's exact error.
  • A TLS registry that never answers the first handshake. Without the fix the test fails with CI's exact TLS handshake timeout error.
  • A missing manifest gets exactly one request, with no retry.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sipsma
sipsma force-pushed the sipsma/registry-pull-retry branch 4 times, most recently from 8c9d803 to eb99d0a Compare November 4, 2026 21:09
tiborvass
tiborvass approved these changes Nov 6, 2026
View reviewed changes
@sipsma
sipsma force-pushed the sipsma/registry-pull-retry branch from eb99d0a to 8b16048 Compare November 6, 2026 20:07
sipsma added 4 commits November 9, 2026 20:47
@sipsma
engine: retry a registry blob fetch after a dropped connection
ebe9bf5
Pulling an image fetched each blob once. When the registry reset the
connection partway through a layer, the pull failed with "failed to
copy: ... connection reset by peer"; containerd's reader only reconnects
after an unexpected EOF. mcr.microsoft.com does this now and then, which
fails TestPlatform/TestWindows.

The pull path that #11856 replaced wrapped this handler in BuildKit's
retry handler, which retries resets, EOFs, temporary network errors and
5xx responses with backoff. Wrap the new one the same way.

Signed-off-by: Erik Sipsma <[email protected]>
@sipsma
engine: retry resolving an image after a network error
511c6a3
Resolving an image sent its manifest request once. When the TLS
handshake with the registry timed out, Container.from failed with
"failed to do request: Head ...: net/http: TLS handshake timeout".
containerd retries a manifest request after some error statuses, but
not after a network error. mcr.microsoft.com does this now and then,
which fails TestPlatform/TestWindows.

Retry the resolve with the same retry handler as a blob fetch: network
errors, resets, EOFs and 5xx responses are retried with backoff, while
a missing image or a refused login still fails at once. This covers
resolving an image's config, its digest, and pulling it.

Signed-off-by: Erik Sipsma <[email protected]>
@sipsma
changes: note that image pulls retry network errors again
ffc44e0
Signed-off-by: Erik Sipsma <[email protected]>
@sipsma
resolver: name the test registry's receivers alike
91a4556
staticcheck's ST1016 wants every method of a type to use the same
receiver name. The test registry's handler names it registry, since r
is its request, so manifestRequests does too.

Signed-off-by: Erik Sipsma <[email protected]>
@sipsma
sipsma force-pushed the sipsma/registry-pull-retry branch 2 times, most recently from e531358 to 91a4556 Compare November 10, 2026 01:01
@sipsma
sipsma merged commit c03e197 into main Nov 10, 2026
97 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@sipsma
sipsma deleted the sipsma/registry-pull-retry branch November 10, 2026 01:25
sipsma added a commit that referenced this pull request Nov 17, 2026
@sipsma
engine: retry reading an image's manifest and config after a network …
9ec9670
…error

#14978 retried resolving an image's root and fetching its layers after a
network error, but resolving then reads the platform manifest and the
image config from the registry without a retry. On mcr.microsoft.com a
reset on the config blob still failed TestWindows: "failed to copy:
httpReadSeeker: failed open: ... write: connection reset by peer".

Retry those reads as a pull's blob fetches are: the metadata fetch every
resolve and pull runs first, and the reads a force pull makes straight
from the registry.

Signed-off-by: Erik Sipsma <[email protected]>
@sipsma sipsma mentioned this pull request Nov 17, 2026
slow engines no longer break a module function's session or its SSH agent #14992
Open
sipsma added a commit that referenced this pull request Nov 17, 2026
@sipsma
engine: retry reading an image's manifest and config after a network …
02a98b1
…error

#14978 retried resolving an image's root and fetching its layers after a
network error, but resolving then reads the platform manifest and the
image config from the registry without a retry. On mcr.microsoft.com a
reset on the config blob still failed TestWindows: "failed to copy:
httpReadSeeker: failed open: ... write: connection reset by peer".

Retry those reads as a pull's blob fetches are: the metadata fetch every
resolve and pull runs first, and the reads a force pull makes straight
from the registry.

Signed-off-by: Erik Sipsma <[email protected]>
sipsma added a commit that referenced this pull request Nov 20, 2026
@sipsma
engine: retry reading an image's manifest and config after a network …
4672a65
…error

#14978 retried resolving an image's root and fetching its layers after a
network error, but resolving then reads the platform manifest and the
image config from the registry without a retry. On mcr.microsoft.com a
reset on the config blob still failed TestWindows: "failed to copy:
httpReadSeeker: failed open: ... write: connection reset by peer".

Retry those reads as a pull's blob fetches are: the metadata fetch every
resolve and pull runs first, and the reads a force pull makes straight
from the registry.

Signed-off-by: Erik Sipsma <[email protected]>
sipsma added a commit that referenced this pull request Nov 20, 2026
@sipsma
engine: retry reading an image's manifest and config after a network …
e583dc0
…error

#14978 retried resolving an image's root and fetching its layers after a
network error, but resolving then reads the platform manifest and the
image config from the registry without a retry. On mcr.microsoft.com a
reset on the config blob still failed TestWindows: "failed to copy:
httpReadSeeker: failed open: ... write: connection reset by peer".

Retry those reads as a pull's blob fetches are: the metadata fetch every
resolve and pull runs first, and the reads a force pull makes straight
from the registry.

Signed-off-by: Erik Sipsma <[email protected]>
sipsma added a commit that referenced this pull request Nov 21, 2026
@sipsma
engine: retry reading an image's manifest and config after a network …
79913da
…error

#14978 retried resolving an image's root and fetching its layers after a
network error, but resolving then reads the platform manifest and the
image config from the registry without a retry. On mcr.microsoft.com a
reset on the config blob still failed TestWindows: "failed to copy:
httpReadSeeker: failed open: ... write: connection reset by peer".

Retry those reads as a pull's blob fetches are: the metadata fetch every
resolve and pull runs first, and the reads a force pull makes straight
from the registry.

Signed-off-by: Erik Sipsma <[email protected]>
sipsma added a commit that referenced this pull request Nov 21, 2026
@sipsma
engine: retry reading an image's manifest and config after a network …
7e3902a
…error

#14978 retried resolving an image's root and fetching its layers after a
network error, but resolving then reads the platform manifest and the
image config from the registry without a retry. On mcr.microsoft.com a
reset on the config blob still failed TestWindows: "failed to copy:
httpReadSeeker: failed open: ... write: connection reset by peer".

Retry those reads as a pull's blob fetches are: the metadata fetch every
resolve and pull runs first, and the reads a force pull makes straight
from the registry.

Signed-off-by: Erik Sipsma <[email protected]>
sipsma added a commit that referenced this pull request Nov 25, 2026
@sipsma
engine: retry reading an image's manifest and config after a network …
8fe71d7
…error

#14978 retried resolving an image's root and fetching its layers after a
network error, but resolving then reads the platform manifest and the
image config from the registry without a retry. On mcr.microsoft.com a
reset on the config blob still failed TestWindows: "failed to copy:
httpReadSeeker: failed open: ... write: connection reset by peer".

Retry those reads as a pull's blob fetches are: the metadata fetch every
resolve and pull runs first, and the reads a force pull makes straight
from the registry.

Signed-off-by: Erik Sipsma <[email protected]>
sipsma added a commit that referenced this pull request Nov 25, 2026
@sipsma
engine: retry reading an image's manifest and config after a network …
6587881
…error

#14978 retried resolving an image's root and fetching its layers after a
network error, but resolving then reads the platform manifest and the
image config from the registry without a retry. On mcr.microsoft.com a
reset on the config blob still failed TestWindows: "failed to copy:
httpReadSeeker: failed open: ... write: connection reset by peer".

Retry those reads as a pull's blob fetches are: the metadata fetch every
resolve and pull runs first, and the reads a force pull makes straight
from the registry.

Signed-off-by: Erik Sipsma <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tiborvass tiborvass tiborvass approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@sipsma @tiborvass
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.