Repository navigation
Release a blocked stream chunk when its RpcClient consumer is interrupted - #8648
Merged
tim-smart merged 3 commits intoOct 1, 2026
Merged
Conversation
dv-waynehaffenden
requested a deployment
to
fork
October 1, 2026 10:46 — with
GitHub Actions
Waiting
Contributor
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|
🦋 Changeset detectedLatest commit: b08cf9d The changes in this PR will be included in the next version bump. This PR includes changesets to release 31 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 |
Merged
This was referenced Oct 4, 2026
This branch is waiting to be deployed
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.
Problem
A streaming request's chunks are delivered with
Queue.offerAllinto a bounded buffer (streamBufferSize, 16 by default). When a chunk is larger than the space left, that offer suspends until the consumer takes. If the consumer is interrupted at that moment, the request's finalizer removes the entry and sendsInterrupt, but nothing ever takes from the queue again — the offer stays suspended forever.With a socket protocol that offer runs inside the single receive loop, so every other request on the connection stalls with it. That includes
Pong: the pinger then reports a ping timeout (surfaced asSocketOpenError: timeout waiting for "open", since the message ignores the cause), the socket is torn down and reconnected, and the cycle repeats whenever a UI re-subscribes a stream while a chunk is in flight.Fix
Shut the stream's queue down in the request finalizer.
Queue.shutdownUnsaferesumes the pending offer, so the receive loop moves on. The queue is now created before the finalizer is registered so the finalizer can reach it.Test
releases a chunk blocked on a full buffer when its stream consumer is interrupteddelivers a three-value chunk into a one-slot buffer whose consumer never finishes, interrupts the consumer, and asserts the delivery completes and theInterruptis sent. It hangs without the fix.Closes EFF-1638