Repository navigation
Conversation
…ating HTTPState.Resolve sent a conditional GET to the origin in every session, even when the caller passed a checksum and the state's snapshot already held content with that digest. The checksum pins the bytes, so the request could only confirm what the engine had. When the origin returned an error, the call failed even though the file was already on disk. Return the snapshot when its digest matches the checksum, and fetch only when it doesn't. Signed-off-by: Yasyf Mohamedali <[email protected]>
Contributor
|
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
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.
Serve an
http()file from the state's snapshot without a request when the caller's checksum matches the snapshot's content digest.HTTPState.Resolverevalidated withIf-None-MatchorIf-Modified-Sincein every session, checksum or not. With a checksum, a 304 can only confirm bytes the engine already holds, and any other answer from the origin failed the call. #15032 has the details.The new test fetches a URL that answers differently on each request (
count: 1, thencount: 2), with the checksum of the first answer, in two sessions. Before this change the second session fetchedcount: 2and failed with a checksum mismatch; now it returnscount: 1without a request.Measured on one engine, with the origin's addresses blocked after a warm run, our CI's image checks, which fetch their GitHub release assets with checksums:
connection refusedFixes #15032.