Repository navigation
fix(moq-cli): an export failure on a live broadcast does not linger - #4947
Conversation
`export ts --linger` waited out the whole linger after any failed end, so an export that failed on its own while the broadcast stayed up waited for a return that cannot come. A failed end now lingers only if the broadcast closes within a 1 s grace, since a killed publisher's tracks can error just before its close arrives; otherwise it exits with the error at once. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 7a7118b
No actionable correctness issue found. rs/moq-cli/src/subscribe.rs:399-408 separates a live-broadcast export failure from a broadcast end without using a racy single state read; zero-linger and clean-end paths remain unchanged. The bounded grace plus existing resume timeout is a sensible direction, and the live AV1 regression exercises the original failure.
Verification: reviewed the full diff, run/resume control flow, paused-time tests and relay-test additions. Static review only; I did not rerun CLI tests or cross-host publisher-loss trials. The one-second classification grace is a deliberate heuristic, so a slower close can still be classified as an export failure. This is a draft COMMENT review, not merge approval.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (6)
💤 Files with no reviewable changes (2)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review. WalkthroughFor nonzero linger, Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to A failed export on a live broadcast exits promptly, while a broadcast that closes can still wait for a restarted publisher. No actionable merge blocker remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 3 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
# Conflicts: # rs/moq-cli/src/args.rs # rs/moq-cli/src/subscribe.rs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Automated review: fix(moq-cli): an export failure on a live broadcast does not lingerOn a failed end with a non-zero This is small and correctly scoped: clean finishes and Findings (non-blocking)
Verdict: MERGE (reviewed head This is an automated review, not the maintainer's decision |
# Conflicts: # doc/bin/cli.md # quest/m1/README.md
|
Merged main again (c9e1ddd) to clear new conflicts. Changes since the reviewed 7a7118b:
The maintainer accepted the OpenAI review of 7a7118b as covering these follow-ups. (Written by Claude Opus 5.5) |
Problem
moq export ts --lingerreads every end of the export as the broadcast ending. An export that failson its own while the broadcast stays up, such as a catalog whose video codec TS cannot carry, waits
out the whole linger for a return that cannot come, since
Source::returnedwaits for the endedbroadcast to close first, and then exits 1. With
--linger 20sagainst an AV1 publisher,mainexits after 23.3 s. Planned as Export linger, from
#4645; the quest is deleted here.
Approach
run_tswaits up toCLOSE_GRACE(1 s, capped at thelinger) for the broadcast consumer to close. If it closes, the failure was the broadcast ending,
and the linger starts as before. If it is still up, the failure is the export's own: it logs a
warning and exits with the error at once.
broadcast's close arrives, so the state is waited for rather than read once.
--linger 0s.Impact
--lingerhelp gains a sentence.Alternatives
errors.
is_closed()once: rejected, since the close can trail the track errors.Validation
closes_within, with paused time: a live broadcast does not close within thegrace, and one closing a quarter of the grace after the failure counts as an end.
an_export_failure_with_the_broadcast_up_exits_without_lingering:--linger 20sagainstmoq import fmp4of the AV1 fixture, with the publisher kept up. It failson
main("exited after 23.27s") and passes here. All fourexportCLI tests pass, including theinterrupted-publisher resume, which ends on a failure and then closes.
export ts --lingerand a PCR-paced broadcast capture, compared withmainatedd671fffon the same arms. With the publisher SIGKILLed and replaced, three sessions resumein 3 of 4 runs here and 2 of 3 on
main, and two sessions in none of 3 on either. One relayrestart lingers and resumes once on both. Clean replay and continue, run here only (×3 each),
resume at every return. The new warning fired in none of them. Across the nine failed ends that
lingered, the broadcast closed within 13.8 ms of the first track error, so on loopback the grace
has about 70× margin; a cross-host relay adds transport delay to that gap, which is what the
margin is for.
moq import tsexits with "rendition is not published" #4945, not this change: on both builds the replacement publisheris handed the killed session's subscriptions, and each such run ends on rendition is not
published or a catalog protocol violation, then lingers once the broadcast closes and exits 1.
just check origin/mainpasses.Follow-ups
moq import tsexits with "rendition is not published" #4945 masks the crash path onmain; once it is fixed, the SIGKILL armsabove should resume in every run.