GeezerVison is showing github.com — engine: retry image pulls and resolves after a network error by sipsma · Pull Request #14978 · dagger/dagger
Conversation
sipsma
commented
Oct 30, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
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.
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]>
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]>
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]>
Uh oh!
There was an error while loading. Please reload this page.
sipsma
added a commit
that referenced
this pull request
Nov 17, 2026
…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 17, 2026
…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
…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
…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
…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
…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
…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
…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]>
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
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.
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.
|