http: Handle missing but unambiguous ETags in response#1159
Merged
tiborvass merged 2 commits intomoby:masterfrom Sep 5, 2019
Merged
http: Handle missing but unambiguous ETags in response#1159tiborvass merged 2 commits intomoby:masterfrom
tiborvass merged 2 commits intomoby:masterfrom
Conversation
Collaborator
|
Please sign your commits following these rules: $ git clone -b "fix-etag" git@github.com:erydo/buildkit.git somewhere
$ cd somewhere
$ git commit --amend -s --no-edit
$ git push -fAmending updates the existing PR. You DO NOT need to open a new one. |
If a single ETag is requested in `If-None-Match`, some servers do not include that (unambiguous) ETag header in the response. For detailed description, see: moby#905 (comment) Signed-off-by: Robert Estelle <robertestelle@gmail.com>
tonistiigi
reviewed
Sep 4, 2019
Otherwise a 200 response without an ETag could be incorrectly associated to previous content in the following scenario: * The remote server had in the past responded with an ETag for this resource, which was cached. - (Otherwise, onlyETag would be empty) * That was the only ETag cached for this resource. - (Otherwise, onlyETag would be empty) * The remote server then stopped supporting ETag/If-None-Match for this resource at all. - (Otherwise, it would respond with a 304 or a 200+ETag) Signed-off-by: Robert Estelle <robertestelle@gmail.com>
This comment has been minimized.
This comment has been minimized.
tonistiigi
approved these changes
Sep 5, 2019
tiborvass
approved these changes
Sep 5, 2019
This was referenced Sep 20, 2019
thaJeztah
added a commit
to thaJeztah/docker
that referenced
this pull request
Oct 24, 2019
full diff: moby/buildkit@f704282...ae10b29 fixes: - moby/buildkit#1144 Fix socket handling - fsutil: Handle copying unix sockets in local sources - update github.com/containerd/continuity to 75bee3e2ccb6 - update github.com/tonistiigi/fsutil to 3d2716dd0a4d - moby/buildkit#1150 ssh: Fix file descriptor leak when doing SSH forwarding - fixes moby/buildkit#1146 SSH Forwarding Doesn't Release File Descriptors - moby/buildkit#1156 llbsolver: Fix using multiple remote cache importers - moby/buildkit#1159 http: Handle missing but unambiguous ETags in response - fixes moby/buildkit#905 ADD from url fails with 'invalid not-modified ETag' - fixes moby/buildkit#784 invalid not-modified ETag with local network ADD in docker - moby/buildkit#1166 solver: Fix possible inefficient parallelization in solver - fix cases where some events were dropped resulting inefficient parallelization. - moby/buildkit#1168 vendor: update go-runc to e029b79d - moby/buildkit#1140 contenthash: Fix bug with symlink in source path of a copy operation - fixes moby/buildkit#974 COPY --from fails when source path involves a symlink - fixes moby/buildkit#785 COPY rpc error: code = Unknown desc = not found: not found - fixes moby/buildkit#958 Issue COPY a file to a symlink directory - moby/buildkit#1139 executor: oom_score_adj is no longer set from main process Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Merged
|
Stupid question? Why is this bug still in "Docker for Mac" which is using a much later version of Buildkit? Docker Desktop (Mac)
Build fails when ADD tries to check Github repository commit with "failed to load cache key: invalid not-modified ETag" What can I do to help resolve the issue? |
Member
|
@BrendonW could you open a new ticket with an example to reproduce the issue? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #905 and #784.
If a single ETag is requested in
If-None-Match, some servers do not include that (unambiguous) ETag header in the response.This has not been tested. I'm developing on a Mac and not able to devote much more time to this bug, but figured it was worth at least a beginner shot at fixing it.
Detailed description from #905 (comment) partially reproduced below:
Reproduction Steps
DockerfileThe first run (or a run after the cache is cleared) succeeds:
DOCKER_BUILDKIT=1 docker build .Running the same command again:
Clearing the cache with
docker builder pruneresets the state.Cause
If a single ETag is requested in
If-None-Match, the server may not include that (unambiguous) ETag header in the response.Detailed demonstration
Requesting the file directly:
Response headers. Notice the ETag.
Requesting the file
If-None-Matchwith that ETag:curl --http1.1 -s -L -D /dev/stderr -o /dev/null -H 'If-None-Match: "ca0368fcd3c4c1a99aca42511d0c1f12"' https://storage.googleapis.com/gpt-2/models/774M/checkpointNotice that the ETag is not included in the response headers.
Requesting the file with multiple ETags in
If-None-Match:curl --http1.1 -s -L -D /dev/stderr -o /dev/null -H 'If-None-Match: "ca0368fcd3c4c1a99aca42511d0c1f12", "foobar"' https://storage.googleapis.com/gpt-2/models/774M/checkpointNow the ETag is included to disambiguate.