[wrangler] Respect and surface 429 errors from HTTP requests - #14877
Merged
NuroDev merged 1 commit intoJul 28, 2026
Merged
Conversation
🦋 Changeset detectedLatest commit: 8f20ad3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 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 |
jasoncabot
commented
Jul 27, 2026
@cloudflare/autoconfig
@cloudflare/config
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
jasoncabot
force-pushed
the
jcabot/retry-after-header-for-wrangler
branch
3 times, most recently
from
July 28, 2026 09:33
0ca7054 to
fb9dfa2
Compare
jasoncabot
marked this pull request as ready for review
July 28, 2026 09:34
workers-devprod
requested review from
a team and
edmundhung
and removed request for
a team
July 28, 2026 09:34
Contributor
|
Codeowners approval required for this PR:
Show detailed file reviewers |
NuroDev
reviewed
Jul 28, 2026
jasoncabot
force-pushed
the
jcabot/retry-after-header-for-wrangler
branch
from
July 28, 2026 15:26
0e5d988 to
d8cff6a
Compare
jasoncabot
force-pushed
the
jcabot/retry-after-header-for-wrangler
branch
from
July 28, 2026 15:28
d8cff6a to
8f20ad3
Compare
NuroDev
approved these changes
Jul 28, 2026
workers-devprod
approved these changes
Jul 28, 2026
workers-devprod
left a comment
Contributor
There was a problem hiding this comment.
Codeowners reviews satisfied
NuroDev
enabled auto-merge (squash)
July 28, 2026 15:48
Merged
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.
The Cloudflare API returns 429 errors with a rate limit header called https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Retry-After
This isn't always set - but in certain cases it is. When it is available we should follow it up to a certain limit to avoid waiting / blocking for too long. I set the limit to be up to a maximum of 60s for now (open to suggestions here). When reaching 60s the request will fail with the original error.
I kept the
isRetryablereturningfalsefor 429 errors in case there was any existing clients as APIError is exported from the public @cloudflare/workers-utils package. If a caller was doing (err.isRetryable()) retryNow() with no backoff it would send another request immediately, making more of a mess. So I put the handling code in the one place that could handle this backoff properly.