Repository navigation
Description
Problem
A live subscription opened with subscribe(None) / group_start: None is documented to start at the latest group. After a reconnect, the same subscription instead requests every group since the last group observed before the outage.
For live playback, this produces a burst of stale frames that downstream QoS drops while the subscriber catches up to the live edge. The longer the outage, the larger the burst, up to the publisher's retention window.
Observed with moq-relay 0.14.8-c8b11b10b after restarting the relay:
FIRST: Dropping frame due to QoS. start:0:07:19.485031770 deadline:0:07:19.485031770 earliest_time:0:07:31.148510106
...
LAST: Dropping frame due to QoS. start:0:07:31.129998770 deadline:0:07:31.129998770 earliest_time:0:07:31.148510106
Approximately 12 seconds / 350-355 frames were replayed and dropped in about 3 seconds. Longer stop/start intervals produced thousands of dropped-frame messages.
Expected behavior
A subscription whose group_start remains None should return to the live edge after reconnect, matching the documented meaning of None. It should not implicitly become a catch-up subscription.
If gapless catch-up across reconnects is required for other consumers, it should be an explicit policy rather than changing the meaning of the live-edge default.
Root cause
This is resume slicing layered on top of subscription aggregation:
moq_native::Client::consumeconfigures origin linger so a relay restart preserves the logical broadcast and subscription across reconnects.model/resume.rs::Producer::takeovercreates a new segment starting at one past the newest group observed on the previous segment.model/resume.rs::slicemaps(prefs.group_start = None, segment.start = Some(n))togroup_start = Some(n).- That explicit bound enters the track subscription aggregate.
- The moq-lite subscriber forwards it upstream as
Subscribe.start_group. - The moq-lite publisher uses the explicit start instead of
track.latest(), replaying the missed range. - Hang media tracks advertise a 30-second retention window, so a substantial missed range can still be available.
The existing model::origin_impl::tests::test_linger_reconnect_splices regression test currently asserts this behavior: a subscriber initially created with subscribe(None) reconnects with producer.subscription().group_start == Some(2). The focused test passes on current main, so the behavior remains present.
Reproduction
- Publish a Hang video track through a relay.
- Consume it through a reconnecting moq-native client with the default
subscribe(None). - Let playback reach steady state.
- Stop the relay for several seconds, then start it again within the reconnect/linger window.
- Observe that the resubscription requests from the last group received before the outage and rapidly replays the missed media instead of starting from the latest group.
Fix considerations
The public semantic and the existing reconnect promise currently conflict:
group_start: Nonesays to start at the latest group.- Origin resume promises to splice a reconnect at the first missing group.
The default should likely preserve live-edge semantics through every segment. Consumers that need catch-up should opt into it explicitly. The implementation and API shape need to preserve both use cases without overloading None.
A regression test should cover a lingering/reconnecting default subscription with multiple groups produced during the outage and assert that only the live edge is delivered after reconnection.
(Written by GPT-5)
Activity
coderabbitai commentedon Aug 12, 2026
🔗 Related PRs
#1137 - Revert next_group to recv_group rename [closed]
#2500 - fix(net): tear down idle upstream subscriptions [merged]
#2534 - fix(moq-net): deliver groups from a takeover source that restarted its numbering [open]
#2537 - feat(net): start and end subscriptions and fetches at a specific frame [merged]
#2771 - fix(net): serve subscriptions in arrival order so reordered groups aren't dropped [open]
📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 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:💬 Have feedback or questions? Drop into our discord!
kixelated commentedon Aug 15, 2026
Heads up that #2785's fix is being reverted on
devin #2852, and will reachmainat the nextdevmerge. The diagnosis here was right; the fix is moving layers rather than being withdrawn.#2785 stopped the replay by making a takeover boundary never become subscription demand. On
devthat is not available: boundaries are frame-precise, and since the read cursor is group-granular the frame offset can only reach the replacement as demand. Under #2785's ruletakeover_splices_mid_groupandtakeover_redelivers_an_incomplete_frameboth fail, so a track whose current group never rolls (a JSON append log, a catalog with deltas) cannot survive a route change at all.The framing that settles it:
start/endare filters, not requests for reliability. A takeover boundary entering the demand aggregate is not a request to replay an outage, and the ceiling on how much gets replayed belongs to the latency budget. A backlog also looks exactly like congestion from the subscriber's side, and the answer to congestion is the ordered consumer skipping ahead, not a special case inresume.What actually changes for this report:
devremoved linger in fix(net): remove linger; a broadcast closes with its last source #2704, and detaching the last source now closes the broadcast synchronously. A single-relay restart ends the subscription instead of splicing.The real fix is to enforce
Subscription::latencyinmoq-netrather than only inmoq_mux::container::Consumer, so a relay hop, amoq-jsontrack, and a rawtrack::Subscriberare covered too: capped byInfo::latency_max, preferring the moq-lite-05 presentation timestamp with a creation stamp as the fallback, applied at both the publisher (aggregate, saves the bandwidth) and the subscriber (per-subscriber, exact). That is a follow-up PR; this issue is the reason it exists.(written by Opus 5)
feat(moq-net): enforce the subscriber latency budget
feat(moq-net): enforce the subscriber latency budget
feat(moq-net): enforce the subscriber latency budget