Skip to content

WebTransportImpl: fail a pending read on stopSending - #661

Open
afrind wants to merge 2 commits into
meta:mainfrom
afrind:stop-sending-on-request-cancel
Open

afrind wants to merge 2 commits into
meta:mainfrom
afrind:stop-sending-on-request-cancel

Conversation

@afrind

@afrind afrind commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

StreamReadHandle::stopSending unregistered the QUIC read callback but left a
pending readStreamData() open. The peer's RESET_STREAM needed that callback to
fail the read, so the read stayed pending until the session closed.
stopSending now fails the pending read with its error code, as
WtStreamManager's ReadHandle does.

FakeSharedWebTransport's stopSending fired the write cancel token before it
finished updating the handle. A peer that closes the session in response
destroyed the handle mid-call, so the token now fires last. The fake also adds
deliverPeerReset, which lets a test deliver a RESET_STREAM to the read half
without resetting the writer.

🤖 Generated with Claude Code

afrind and others added 2 commits November 2, 2026 11:52
StreamReadHandle::stopSending unregistered the QUIC read callback but left a
pending readStreamData() promise open. The peer's solicited RESET_STREAM then
had no callback to arrive on, so the read did not complete until session
teardown. Fail the pending read, as WtStreamManager's ReadHandle does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FakeStreamHandle::stopSending fired the write cancel token before it finished
updating the handle. The fake wires both sessions together on one thread, so
the peer reacts inside that call. A peer that closes the session then destroys
the handle, and the rest of stopSending touched freed memory. Fire the token
last, as resetStream already does.

Add deliverPeerReset, which fails a read half without resetting the writer.
resetStream also fires the writer's cancel token, so a session on the writing
side reacts to its own reset and the reader cannot see a RESET_STREAM alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@afrind
afrind requested a review from hanidamlaj November 2, 2026 20:03
@meta-cla meta-cla Bot added the CLA Signed label Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant