You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
close() returns Ok, the subscriber still gets a cut track #4508
A publisher finishes its track and awaits close(), which returns Ok(()). The subscriber does not get all of the track: the final group is missing or cut, and the subscription ends with an error.
Expected
When close() returns Ok, the subscriber reads every frame of the finished track, then a clean end (Ok(None)).
One session over the mock transport, paused clock, fails on every run:
moq-lite-05: the close returned Ok, the subscriber got ["head"], err=Some(Session(Cancel))
The subscriber reads a head group; the publisher writes the final group, finishes the track and awaits Session::close(). The final group is complete in the subscriber's transport before the close. The test adds one switch to the test mock, ack_fins(): a FIN is acknowledged as soon as it is sent, as on a real transport. By default the mock acknowledges a FIN once the peer's application is done with the stream. A second test keeps the session open; it passes.
Impact
Any publisher that ends a broadcast and leaves: a file import, an encoder stopping, a GStreamer pipeline going to NULL. Viewers lose the end of the last group and see an error where the end of the track should be. The publisher is told the close succeeded, so it has nothing to retry on.
With moqsink → relay → moqsrc the last frame of 120 is missing in 3 of 10 rounds over TCP and 1 of 10 over QUIC, and moqsrc posts a session error, not EOS, in every round.
Decision: a per-subscription FIN handshake. On moq-lite-07, the subscriber FINs its side of the Subscribe Stream once its tail accounting settles the track's end. A graceful close() waits for that FIN (or a reset) on every served subscription before CONNECTION_CLOSE, under the same one-second deadline. Today close() returns once the peer's QUIC stack acks the data, and QUIC discards whatever the subscriber hasn't read yet.
Scope: lite-07 only, since it is still a work in progress and the draft can require the subscriber FIN there. lite-05 and lite-06 subscribers never FIN, so waiting for one would time out every close; those versions keep today's ack-based drain, including this issue's lite-05 repro. The quest's PR closes this issue.
Activity
quest(m1): plan #4456, #4508, #4581, #4582 (#4587)
kixelated commentedon Sep 30, 2026
Thanks for the reproducer. Planned in #4587 as
quest/m1/close-tail.md.Decision: a per-subscription FIN handshake. On moq-lite-07, the subscriber FINs its side of the Subscribe Stream once its tail accounting settles the track's end. A graceful
close()waits for that FIN (or a reset) on every served subscription beforeCONNECTION_CLOSE, under the same one-second deadline. Todayclose()returns once the peer's QUIC stack acks the data, and QUIC discards whatever the subscriber hasn't read yet.Scope: lite-07 only, since it is still a work in progress and the draft can require the subscriber FIN there. lite-05 and lite-06 subscribers never FIN, so waiting for one would time out every close; those versions keep today's ack-based drain, including this issue's lite-05 repro. The quest's PR closes this issue.
(Written by Claude Opus 5.5)
test(net): a graceful close delivers what the peer's transport holds