fix(orchestrator): tolerate unsignable uploads on a layer cache hit - #3633
Draft
michalsuba-e2b wants to merge 1 commit into
Draft
fix(orchestrator): tolerate unsignable uploads on a layer cache hit#3633michalsuba-e2b wants to merge 1 commit into
michalsuba-e2b wants to merge 1 commit into
Conversation
A cache hit needs no upload URL, but InitLayerFileUpload minted one before checking Exists, so any provider that cannot sign an upload URL for an external client failed every COPY instruction — including the ones whose layer files were already cached. Azure is that provider: Put Blob requires the x-ms-blob-type request header, which a SAS cannot carry. Exists now runs first and a signing failure is fatal only on a miss, and only for the typed ErrSignedUploadURLUnsupported sentinel so a broken credential still surfaces. Cache misses on Azure keep failing until signed uploads land. GCS, S3 and the filesystem provider are unchanged: they still return the URL on a hit, which is what the SDK gates forceUpload re-uploads on. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
InitLayerFileUploadminted the upload URL before checkingExists, so a provider that cannot sign an upload URL for an external client failed everyCOPYinstruction — even when the layer files were already cached. Azure is that provider:Put Blobrequires thex-ms-blob-typerequest header, which a SAS cannot carry.Existsnow runs first, and a signing failure is fatal only on a cache miss and only for the new typedstorage.ErrSignedUploadURLUnsupportedsentinel, so a genuinely broken credential still errors. GCS/S3/fs responses are unchanged — they keep returning the URL on a hit, which is what the SDK gatesforceUploadre-uploads on. Cache misses on Azure still fail; the signed-upload fix is the follow-up PR.Verification:
go test ./packages/orchestrator/pkg/template/server/... -race(linux container) — new tests cover hit/miss × sentinel/other-error, and the tolerance branch is mutation-verified (swap the sentinel, the cache-hit test fails).go test ./packages/shared/pkg/storage/ -run TestAzureIntegrationgreen against Azurite.Sponsor: @michalsuba-e2b
🤖 Generated with Claude Code