Repository navigation
Answer a revalidated GET with the cached body - #216
Merged
Merged
Conversation
HttpLookup remembered each URL's ETag and sent If-None-Match on the next GET,
but kept no body, so a repeat fetch in one JVM got a bodiless 304.
zipxSnapshotAdvance after zipxSnapshotStatus failed on it ("HTTP 304"), and
catalog lookups read it as an artifact that is not there.
The cache now holds the last answer with an ETag per URL. A 304 to its own
revalidation returns that answer, so no caller sees a 304 it did not ask
for. A caller that passes its own If-None-Match still gets the server's 304.
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.
A repeat GET in one JVM gets the body, not a bodiless 304.
The bug
HttpLookupremembered each URL's ETag and sentIf-None-Matchon the next GET to it, but it kept no body. A second fetch of the same URL in one sbt session got a304with nothing in it. That broke two callers:zipxSnapshotAdvancefailed afterzipxSnapshotStatuson the pointer metadata both read. Found adopting the stack in heddle:zipxDepUpdatein one session could drop a platform, or a whole row.The fix
ifNoneMatchgets the server's 304, as before.MavenMetadatano longer reads a 304 as a miss. One can only reach it now as a real error.Tests
HttpLookupSpec:If-None-Matchgets the server's 304 back.sbt "scalafmtAll; cleanFull; testFull": 122 suites passed.zipxWorkflowCheck: every generated file up to date.plugin/scripted: all 24 fixtures passed.