Skip to content

Draft 18: a TRACK_STATUS followed at once by the requester's FIN is reset instead of answered #7438

Closed

Description

@michaelstuurman

On draft 18, moq-net's IETF publisher reads a requester FIN as withdrawal of the request (request_stream::fin_cancels, matches!(version, Version::Draft18)). For TRACK_STATUS, a FIN that arrives before the answer is written ends serve_track_status_stream without TRACK_STATUS_OK or REQUEST_ERROR. Dropping the stream then resets it with CANCELLED (0x1, Writer::drop).

until_withdrawn checks for the withdrawal before the lookup, so this happens even for a track the publisher holds: resolve() returns Ok(None) and serve_track_status_stream returns at publisher.rs:3180 (main 80e29de). A FIN that arrives later is caught by poll_cancel (3195). Only refusals made before resolution (namespace, auth) are still answered. @moq/net's RequestStream does the same.

moxygen FINs right after it sends TRACK_STATUS on draft 18+ (MoQSession::trackStatus: "No REQUEST_UPDATE channel for TRACK_STATUS — FIN now", MoQSession.cpp:6964-6967 on facebookexperimental/moxygen 99c696b22, 6928-6931 on openmoq/moxygen 0e23cf2), and it reports the reset as "peer closed stream before reply". So a TRACK_STATUS that moqx forwards to a moq-dev publisher is never answered.

Reproduction, all on draft 18 over raw QUIC:

  • moqx v0.3.6-92-gb6e6b831 (openmoq/moxygen 0e23cf2), one relay with a catch-all service.
  • Publisher: moq … import fmp4 from main 80e29de, connected straight to moqx.
  • moq-relay from 80e29de, with moqx as its upstream cluster peer, and a moq-lite viewer (moq … export fmp4) on moq-relay.

The viewer's TRACK request for catalog.json becomes a TRACK_STATUS from moq-relay to moqx, which forwards it to the publisher followed by a FIN. With the publisher at trace, it logs received track_status and encodes nothing for that request. About 18 ms later moq-relay gets REQUEST_ERROR 0xFFFFFFFF, the TRACK request fails, and the viewer never subscribes.

In a unit test that sends TRACK_STATUS and FINs right after it, draft 18 writes no bytes and resets with 0x1, while drafts 20 and 22 answer TRACK_STATUS_OK and FIN.

Fix in #7439: a FIN only ends a TRACK_STATUS requester's input, on every draft; a reset or STOP_SENDING still withdraws it.

With that fix, the setup above fails one step later for a separate reason: moqx's moxygen writes a GROUP_ORDER parameter into TRACK_STATUS_OK, which draft 18 does not allow there, so TrackStatusOk::decode_msg refuses it. That is fixed in facebookexperimental/moxygen aaa50a77 (#264), not yet in openmoq/moxygen. With moq-relay also skipping that parameter (a local test patch, not proposed here), the viewer plays the broadcast through moqx: catalog, video and audio.

What draft 18 says about the FIN. It does not settle what such a FIN means:

  • §10.14 makes TRACK_STATUS "the first and only message on a new bidi stream" and says "the subscriber cannot send REQUEST_UPDATE".
  • §3.3.2 (Request Cancellation and Rejection) says implementations SHOULD cancel "by resetting or sending STOP_SENDING".
  • The only requests draft 18 says a FIN cancels are SUBSCRIBE_NAMESPACE and SUBSCRIBE_TRACKS (§6.1).
  • §11.4.1 ("Termination of a bidi request stream terminates the … Track Status … request") can be read as any termination, a FIN included, ending the request.

The WG took this up as moq-wg/moq-transport#1634. There afrind wrote "For TRACK_STATUS an early FIN is perfectly normal", and ianswett, after London: "It makes sense to send a FIN immediately after TRACK_STATUS, because you can't update a TRACK_STATUS". moq-wg/moq-transport#1698 then put this in draft 19 §3.3.2 (Graceful Request Stream Closure; draft 22 §6.4.2.2): "A FIN only indicates that an endpoint will send no further messages in that direction; it is not a request cancellation." The same section says: "A requester, with the exception of the sender of PUBLISH, MAY FIN immediately after sending a message if it will not send a REQUEST_UPDATE."

The fix keeps the draft-18 FIN cancel for every other request, since moq-dev's own draft-18 requesters cancel by FIN. Dropping it everywhere, as moq-net already does on drafts 20 and 22, would be the broader option. moxygen FINs early only on TRACK_STATUS.

Related: #7423.

(Written with Claude Opus 5.5)

Activity

  1. coderabbitai commented on Oct 31, 2026

    @coderabbitai
    Contributor
    🔗 Related PRs

    #6964 - fix(net): end withdrawn IETF requests during resolution [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

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

    @kixelated
    Collaborator

    Planned in moq-dev/moq#7441 as quest/m1/interop-coverage/draft18-status-fin.md. Maintainer decision (2026-10-31): the fix keeps the TRACK_STATUS-only scope of moq-dev/moq#7439. On every draft, a FIN only ends a TRACK_STATUS requester's input, while every other draft-18 request still treats a requester FIN as a cancel. So #7439 can come out of draft for review. The quest also removes the stale doc/concept/standard.md sentence found in #7423.

    Once the plan merges, anyone who wants to donate tokens can run /quest-start quest/m1/interop-coverage/draft18-status-fin.

    (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