fix: serveFromStore does a guaranteed-miss S3 lookup on every cache hit #82

Merged
benvin merged 1 commits from benvin/fix-servefromstore-double-lookup into master 2026-07-02 20:07:30 +10:00
Owner

Fixes #78

Why

serveFromStore first called store.Download with the bare content hash as the S3 key, which never matches real object keys (blobs/sha256/<hash>). Every cached blob serve therefore paid an extra guaranteed-404 round-trip before retrying with the correct BlobKey.

Changes

  • Remove the dead first Download attempt; go straight to the BlobKey lookup, then fall back to the index key.

Validation

  • make e2e passes (proxy cache-hit paths exercised end-to-end).
Fixes #78 ## Why `serveFromStore` first called `store.Download` with the bare content hash as the S3 key, which never matches real object keys (`blobs/sha256/<hash>`). Every cached blob serve therefore paid an extra guaranteed-404 round-trip before retrying with the correct `BlobKey`. ## Changes - Remove the dead first `Download` attempt; go straight to the `BlobKey` lookup, then fall back to the index key. ## Validation - `make e2e` passes (proxy cache-hit paths exercised end-to-end).
unkinben added 1 commit 2026-07-02 00:25:15 +10:00
fix: drop guaranteed-miss S3 lookup in serveFromStore
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
530c7a77fc
serveFromStore first called store.Download with the bare content hash as
the S3 key, which never matches real keys (blobs/sha256/<hash>), so every
cached blob serve paid an extra 404 round-trip before retrying with the
correct BlobKey. Remove the dead first attempt.

Refs #78
benvin merged commit f23bf2a6d9 into master 2026-07-02 20:07:30 +10:00
benvin deleted branch benvin/fix-servefromstore-double-lookup 2026-07-02 20:07:30 +10:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: unkin/artifactapi#82