Skip to content

IETF stream resets send moq-lite error codes, so routine events read as INTERNAL_ERROR #3001

Closed

Description

@kixelated

Split out of #2993, where the cancellation path was fixed narrowly and the general case deliberately was not.

Error::to_code() encodes the moq-lite space, where Cancel is 0. On the moq-transport wire, draft-19 section 3.3.4 assigns 0x0 to INTERNAL_ERROR and 0x1 to CANCELLED. Every IETF stream reset that goes through Reader::abort/Writer::abort therefore sends a code from the wrong registry.

The most visible case is ietf/session.rs, where a failed run_uni_group does reader.abort(&err). A group arriving for an alias the subscriber retired by its own cancellation is an expected late object, and it stops the stream with 0 -- the publisher reads a routine event as an internal failure on our side.

#2993 fixed exactly one site (cancel_subscribe, via a named STREAM_CANCELLED and a raw-code Reader::stop) because it could be shown safe there: the publisher treats its request stream reader closing as Ok(()) and never inspects the code.

The general fix is not a matter of passing 1 at each remaining site, which is why it was not folded in:

  • Error::from_transport maps only 0 back to Cancel. Changing outgoing codes without it makes two moq-net IETF peers disagree, so a routine cancellation surfaces as Remote(1) and can move an expected event into error paths.
  • Both directions have to change together, and the mapping is shared with moq-lite, whose code space is unrelated.

So this wants a per-protocol code mapping (outgoing and incoming) rather than a scattering of literals. The js/net counterpart is #2999: there the abstraction cannot express a code at all.

(written by Opus 5)

Activity

  1. kixelated commented on Aug 22, 2026

    @kixelated
    CollaboratorAuthor

    Half of this landed in #2993 (c5e26f2): ietf::error names the section 3.3.4 registry and maps an error onto it, and the IETF paths that stop a stream now use it, so a cancellation reports CANCELLED rather than moq-lite's 0.

    The reason given for deferring the whole thing was wrong. I claimed the outgoing change needed the incoming one to avoid two moq-net peers disagreeing; the publisher discards its group task results and never reads the code, so it did not.

    What remains is genuinely the incoming direction: Error::from_transport decodes 0 back to Cancel for every protocol. On the moq-transport wire 0 is INTERNAL_ERROR, so a peer reporting a real internal failure is read as a routine cancellation. Fixing it needs the decode to know which protocol the stream belongs to, which the shared coding layer currently does not.

    (written by Opus 5)

  2. added
    questBeing tracked/planned in a quest. See `quest/`
    on Sep 7, 2026
  3. kixelated commented on Oct 19, 2026

    @kixelated
    CollaboratorAuthor

    Fixed by #3450: IETF reset codes are encoded and decoded per negotiated draft.

    (Written by Claude Opus 5.5)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    questBeing tracked/planned in a quest. See `quest/`

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions