Repository navigation
fix(net): a pre-lite-07 tail owes nothing below SUBSCRIBE_START - #9536
Conversation
Before lite-07 nothing answers a SUBSCRIBE_UPDATE, and the publisher applies none once it has sent its FIN. A floor an update lowered below SUBSCRIBE_START as the track ended was still owed, so the subscriber held its FIN for the tail grace, and the publisher's draining close timed out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No configured credential can serve this run. Your Claude subscription has hit its usage limit, which resets at 2026-11-25 06:00 UTC. Re-trigger after it resets, or add an API key for this provider, which Pullfrog falls back to automatically. The providers' responses
|
|
No actionable comments were generated in the recent review. WalkthroughThe JS and Rust Lite subscribers now prevent a lowered requested floor from making groups below the answered Merge Risk:
|

Problem
Before lite-07 nothing answers a SUBSCRIBE_UPDATE, and a lite-05/06 publisher applies none once it has sent its FIN. A subscriber copy still owed the groups an update newly asked for below SUBSCRIBE_START. When a reader lowers the floor around the moment the publisher ends the track, the update reaches the publisher after its FIN, or is sent only after SUBSCRIBE_END arrived. The groups it asked for are then never sent or dropped.
The copy then holds its FIN for the tail grace, which is never under 1 s. The publisher's draining close waits for that FIN for at most 1 s, so
Session::closefails withdelivery timeout.A relay hits this when a broadcast ends while a reader re-attaches from history. The route moves, the reader asks its copy from group 0 (
Absolute(0)), and the copy sends that update right afterSUBSCRIBE_END. Instrumented logs from a failing run:Approach
SubStream::owed): before lite-07 the owed groups never start below SUBSCRIBE_START. An update can still raise the floor, and a lowered group that arrives before the tail settles is still delivered. Lite-07 is unchanged, since it answers every range an update adds with its own SUBSCRIBE_START.Subscriber.#covered): the same rule, for parity.The cost is that, before lite-07, a stream for a group a lowered floor asked for is no longer waited for if its header hasn't arrived by the FIN. A stream whose header has arrived is still read to its end. The publisher finishes every group stream before it FINs, so this window is only reordering in flight. Before lite-07 the subscriber can't tell that case apart from an update the publisher never read, and only lite-07's per-range SUBSCRIBE_START settles it exactly.
Impact
Tests
a_floor_lowered_as_the_publisher_ends_owes_nothing_below_start(moq-net, lite-05 and lite-06). It uses the memory transport. The publisher answers SUBSCRIBE_START, a second reader lowers the floor, and the publisher sends END and FIN without applying the update. The copy must FIN with no time passing. Onmainit fails with no FIN.the_owed_floor_follows_the_demand. A floor lowered below START now owes from START, and its disjoint-ranges case moved above START. The old assertion fails onmain.a lowered floor owes the groups it newly asked forkeeps that name and assertion for lite-07. For lite-05/06 it becomesa lowered floor owes nothing below SUBSCRIBE_STARTand asserts that the subscriber FINs within 50 ms, under the 60 s grace. It fails onmainfor both versions.Validation
nix develop --command just ci origin/mainpasses: Rust 11428 tests passed and 146 skipped, plus the JS suites.moq-lite-06. One client publishes audio and a catalog, then finishes them and closes the session cleanly, while the other client's reader re-attaches. The moq-ffi wheel was built withmaturin build --release.main(d791d549a6, this branch's base): 8 of 20 runs failed, all withMoqError.Protocol: delivery timeoutfrom the clean close. A separate run with debug logs failed 4 of 10.tracinginstrumentation, not committed, logged the copy's owed set and tail ledger in failing runs onmain.owed=[0..10109]against a ledger covering10000..10109, with the update buffered afterSUBSCRIBE_END. That confirmed the mechanism above before the fix was written.Caused by
f1871e210a.Alternatives
Decisions
main(rejected: a real-QUIC moq-net or relay test; once the trigger is known, the fault doesn't depend on the transport).Follow-ups
start_atalso reopens the groups below START for its readers. In the unit harness, a live reader on the finished copy then did not end at once. It no longer delays the FIN, but readers may still wait out their own grace. Possible quest: the same acknowledged-floor rule for reader declarations before lite-07.Models
Size: S
Implementer: Claude Code, claude-opus-5-5, unknown effort
🤖 Generated with Claude Code
(Written by Claude Opus 5.5)
Review
Rewritten by
quest reviewafter each round.Head: e7c0438
Base: origin/main at d791d54
Risk: medium,
If the `owed()` change in `js/net` and `rs/moq-net` is wrong, a pre-lite-07 subscriber could hold or close a track's subscription incorrectly for publishers and relays that use it, but the fix keeps the public API and wire format and a revert undoes it fully, so this is a bug fix in shipped code, which is medium rather than high.Classified: medium by Claude Code, claude-haiku-5-5, low effort, session
561b6f02-5038-4e30-9c9d-8cf1ef65cefaReviewer: Codex, gpt-6.1-sol, medium effort
Session:
01a20d8b-c397-7bf2-a9af-fecc587ef1e9, round 1Score: 9/10,
The change consistently clamps pre-lite-07 tail obligations to SUBSCRIBE_START across Rust and JS with no actionable regression found, though builds and tests were not run as instructed.Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none
Reviewer: Codex, gpt-6.1-sol, high effort, shadow
Session:
01a20d8b-c397-7132-9a20-026c82453214, round 1Score: 9/10,
The Rust and JavaScript tail-accounting changes are consistent with no actionable regressions found, pending automated validation because the review was static.Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none