Repository navigation
[deploy-helpers] respect Retry-After during asset uploads - #15632
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 82ff150 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
|
LGTM! |
@cloudflare/autoconfig
@cloudflare/build-output-utils
@cloudflare/codemods
@cloudflare/config
@cloudflare/containers-shared
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-functions
@cloudflare/pages-shared
@cloudflare/runtime-types
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-plugin
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
petebacondarwin
force-pushed
the
fix/asset-upload-retry-after
branch
from
September 13, 2026 12:46
e6494f9 to
a3bf57a
Compare
Base automatically changed from
fix/asset-upload-concurrency-recovery
to
main
September 14, 2026 12:52
workers-devprod
requested review from
a team and
dario-piotrowicz
and removed request for
a team
September 14, 2026 12:53
Contributor
|
Codeowners approval required for this PR:
Show detailed file reviewers
|
petebacondarwin
force-pushed
the
fix/asset-upload-retry-after
branch
from
October 7, 2026 09:41
eaab2b4 to
82ff150
Compare
Contributor
|
Codeowners approval required for this PR:
Show detailed file reviewers |
workers-devprod
approved these changes
Oct 7, 2026
workers-devprod
left a comment
Contributor
There was a problem hiding this comment.
Codeowners reviews satisfied
Merged
brandhaug
added a commit
to brandhaug/b2b-saas-starter
that referenced
this pull request
Oct 11, 2026
## pnpm-workspace.yaml (default) ## Dependency Updates | Package | From | To | Type | | --- | --- | --- | --- | | `wrangler` | 4.148.0 | 4.149.0 | minor | ## Release Notes <details> <summary><b>wrangler</b> (4.148.0 → 4.149.0)</summary> ### Minor Changes - [#16036](cloudflare/workers-sdk#16036) [`9a58244`](cloudflare/workers-sdk@9a58244) Thanks [@<!---->edevil](https://github.com/edevil)! - Support temporary event accounts in R2 and Containers commands `wrangler r2` and `wrangler containers` commands now accept the hidden `--temporary` flag, so accounts created for an event can manage buckets, objects and containers directly. Every command that supports `--temporary` now also accepts a hidden `--event-code` flag, so the first command a participant runs can create the event account: `wrangler r2 bucket create my-bucket --temporary --event-code <code>` R2 and Containers are only available on event accounts. R2 custom domains, Sippy, external container registries and `wrangler cloudchamber` commands still require a logged-in account. ### Patch Changes - [#16139](cloudflare/workers-sdk#16139) [`2d1d563`](cloudflare/workers-sdk@2d1d563) Thanks [@<!---->cpojer](https://github.com/cpojer)! - Update esbuild to 0.28.2 Align esbuild dependency with tooling using the latest 0.28 patch so package managers can share one installation instead of downloading a second native binary. - [#15632](cloudflare/workers-sdk#15632) [`85b14e7`](cloudflare/workers-sdk@85b14e7) Thanks [@<!---->petebacondarwin](https://github.com/petebacondarwin)! - Honor Retry-After directives during static asset uploads Static asset uploads now pause retries and pending uploads until the latest outstanding deadline requested by the API. A per-request limiter also keeps gateway retries at the reduced concurrency after the pause ends, preventing a deployment from immediately overloading a constrained asset service again. - [#16098](cloudflare/workers-sdk#16098) [`fe607f9`](http …[full notes](https://github.com/cloudflare/workers-sdk/releases/tag/wrangler%404.149.0) </details> --- *This PR was auto-generated by [catalog-update-action](https://github.com/brandhaug/catalog-update-action).* Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 task
1 task
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.
Partially addresses #15060.
The fetch layer exposes
Retry-AfterasAPIError.retryAfterMs, but static asset uploads ignored it and retried using short local delays. A response such asRetry-After: 120could therefore be retried after only a few seconds while the asset service was asking the client to pause.This change pauses retries and queued upload requests until the latest outstanding
Retry-Afterdeadline, giving that deadline precedence over local backoff. Both queues are paused before the failed request releases its limiter slot. A request-level limiter keeps simultaneous gateway retries at concurrency one, then restores capacity gradually after successful uploads. Long deadlines use safe timer slices to avoid Node's large-setTimeoutclamp.If an upload exhausts its retries, the session cancels queued work, aborts active requests, and clears retry timers. Late responses cannot restart the failed deployment or keep the CLI alive with a new Retry-After timer.
The tests simulate a 120-second directive without waiting in real time. They verify that failed requests and queued assets stay paused, queued gateway retries remain serialized, concurrency recovers, and terminal failures cancel pending work without scheduling late retries.
Validation: Wrangler asset tests (52/52), deploy-helpers tests (246/246), both packages' source and test typechecks, oxfmt, and oxlint passed using Node 22.22.1 and pnpm 10.33.0.
Scope: this covers Workers static asset upload requests handled by
syncAssets(). Retry handling for the initialassets-upload-sessionrequest and the separate Pages/pages/assets/uploadpath is unchanged.Note
This is a contribution from an AI agent: OpenAI Codex (GPT-5).