Retry the web handler layer build after a failed or aborted first request - #7505
Open
Sanjay-doppalapudi wants to merge 1 commit into
Open
Retry the web handler layer build after a failed or aborted first request#7505Sanjay-doppalapudi wants to merge 1 commit into
Sanjay-doppalapudi wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 279eb6c The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 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 |
Sanjay-doppalapudi
requested a deployment
to
fork
August 27, 2026 23:32 — with
GitHub Actions
Waiting
Sanjay-doppalapudi
requested a deployment
to
fork
August 27, 2026 23:32 — with
GitHub Actions
Waiting
Contributor
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|
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.
HttpEffect.toWebHandlerLayerWith(and everything built on it:toWebHandlerLayer,HttpRouter.toWebHandler) builds its layer lazily inside the first request and memoizes the resulting promise. On runtimes that never settle promises created inside an aborted request (e.g. Cloudflare workerd), a client-aborted first request left that memoized promise pending forever, permanently hanging every subsequent request in the isolate (error 1101). A failed build was likewise memoized forever, so one transient build error failed all later requests.The memoized build is now forgotten when it fails, or when the request that started it aborts before the build completes, so a later request retries the build instead of chaining onto a dead promise. An in-flight build is never interrupted: on runtimes where the promise does settle it still populates the handler cache as before, and the forget guard makes late settles and aborts no-ops.
Tests: two regressions — an aborted initiating request no longer wedges the next request (times out at HEAD without the fix), and a failed build is retried instead of replaying the memoized rejection (fails at HEAD). Verified 2 failed / 18 passed pre-fix, 20 passed post-fix.
Closes #6319 (filed against v3
HttpApp.toWebHandlerLayerWith; the same memoization lives ineffect/unstable/http/HttpEffect.tson main).