STOR-5552: Preserve in-flight WebSocket auto-responses (with fix) - #7083
Open
apeacock1991 wants to merge 2 commits into
Open
STOR-5552: Preserve in-flight WebSocket auto-responses (with fix)#7083apeacock1991 wants to merge 2 commits into
apeacock1991 wants to merge 2 commits into
Conversation
Track auto-response sends in the hibernation manager so revived WebSockets wait before writing. Queue completion alongside pending responses and retain the message buffer independently of the legacy adapter. Cover direct, queued, packaged, cancellation, and repeated-revival paths.
Move the WebSocket auto-response state under IoOwn so V8 garbage collection defers destruction of its KJ async objects to the owning IoContext. Retain direct access for hibernation-manager operations that run without a current IoContext.\n\nAdd coverage for collecting a hibernated WebSocket while its auto-response send is still in flight.
Contributor
|
LGTM |
harrishancock
approved these changes
Aug 21, 2026
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.
Re-implements #7065, with a fix on top to address https://sentry10.cfdata.org/organizations/cloudflare/issues/40148809/?project=204&query=&referrer=issue-stream&statsPeriod=24h that was seen during deploy.
The fix moved WebSocket auto-response state into IoOwn, so V8 cannot destroy active KJ promises during GC. Their IoContext now handles cleanup. A regression test covers GC during an in-flight auto-response.