Skip to content

fix(orchestrator): tolerate unsignable uploads on a layer cache hit - #3633

Draft
michalsuba-e2b wants to merge 1 commit into
mainfrom
feat/layer-upload-cache-hit-tolerance
Draft

fix(orchestrator): tolerate unsignable uploads on a layer cache hit#3633
michalsuba-e2b wants to merge 1 commit into
mainfrom
feat/layer-upload-cache-hit-tolerance

Conversation

@michalsuba-e2b

Copy link
Copy Markdown
Contributor

InitLayerFileUpload minted the upload URL before checking Exists, so a provider that cannot sign an upload URL for an external client failed every COPY instruction — even when the 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 cache miss and only for the new typed storage.ErrSignedUploadURLUnsupported sentinel, 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 gates forceUpload re-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 TestAzureIntegration green against Azurite.

Sponsor: @michalsuba-e2b

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant