Skip to content

STOR-5552: Preserve in-flight WebSocket auto-responses (with fix) - #7083

Open
apeacock1991 wants to merge 2 commits into
mainfrom
apeacock/STOR-5552-reapply
Open

STOR-5552: Preserve in-flight WebSocket auto-responses (with fix)#7083
apeacock1991 wants to merge 2 commits into
mainfrom
apeacock/STOR-5552-reapply

Conversation

@apeacock1991

Copy link
Copy Markdown
Contributor

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.

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.
@apeacock1991
apeacock1991 requested review from a team as code owners August 21, 2026 12:52
@apeacock1991 apeacock1991 changed the title Apeacock/stor 5552 reapply STOR-5552: Preserve in-flight WebSocket auto-responses (with fix) Aug 21, 2026
@ask-bonk

ask-bonk Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

LGTM

github run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants