Skip to content

fix(moq-transport): treat unmapped stream reset codes as stream errors - #317

Open
bmertens-datum wants to merge 1 commit into
cloudflare:mainfrom
bmertens-datum:fix/invalid-reset-is-stream-error
Open

bmertens-datum wants to merge 1 commit into
cloudflare:mainfrom
bmertens-datum:fix/invalid-reset-is-stream-error

Conversation

@bmertens-datum

Copy link
Copy Markdown

Fixes #316.

What this changes

Over raw QUIC, web_transport_quinn::Session::raw still maps RESET_STREAM and STOP_SENDING codes through error_from_http3. A MoQT code with no WebTransport mapping (for example, 5) therefore arrives as ReadError::InvalidReset or WriteError::InvalidStopped. SessionError::is_stream_error() didn't list those variants, so is_session_fatal() closed the whole session when a peer ended one stream.

This PR counts both variants as stream errors, the same as Reset and Stopped. It also adds a unit test covering both.

Testing

  • cargo fmt --check and cargo clippy --no-deps are clean.
  • All tests pass, including the new one, except moq-relay-ietf's producer::tests::cancelled_remote_subscribe_*. Those fail intermittently on unmodified main too (1 run in 3 on both main and this branch, at the same 2 s timeout), so the failure is unrelated to this change.
  • End to end: a Norsk draft-18 publisher over moqts:// reproduced Raw-QUIC stream reset with an unmapped code closes the whole session (InvalidReset treated as session-fatal) #316 against a relay built from draft-18-dev. With this change applied, the session stays up and a browser (@moq/watch 0.6.2) plays its 1080p25 broadcast through the relay. The relay now logs only failed to serve stream ... invalid RESET_STREAM: 5 as a warning.
  • The InvalidStopped half is from reading the code; the end-to-end test only exercised resets.

🤖 Generated with Claude Code

Over raw QUIC, web_transport_quinn::Session::raw still maps RESET_STREAM
and STOP_SENDING codes through error_from_http3. An ordinary MoQT code
such as 5 has no WebTransport mapping, so it arrives as
ReadError::InvalidReset or WriteError::InvalidStopped.

is_stream_error() did not list those variants, so is_session_fatal()
returned true and run_streams() closed the whole session when a peer
reset a single data stream.

Count InvalidReset and InvalidStopped as stream errors, like Reset and
Stopped.

Fixes cloudflare#316

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Raw-QUIC stream reset with an unmapped code closes the whole session (InvalidReset treated as session-fatal)

1 participant