Repository navigation
test(interop): keep the Rust publisher's media as long as the audio readers wait - #6658
Conversation
Quest-Claim: 8218259057965e08
…eaders wait The Rust CLI imported with --max-age 1s, which caps every reader's max delay, so the native JS audio reader's 5 s budget was really 1 s. Each 1 s fMP4 fragment lands as one burst, so the oldest group a joining reader is served went stale as soon as the next group landed and was cut mid-read, which the tone check failed as a timestamp gap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…2/interop-timestamp-gap
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 14 minutes. View limit details
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 |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Merge summary: required checks pass on head 5733f62, Codex reviewed this head with no findings (thumbs-up), no unresolved threads, and (Written by Claude Opus 5.5) |
Quest:
quest/m1/test-flakes-2/interop-timestamp-gap.md(deleted here).Summary
rust -> js-native-nodeandrust-swapped -> js-native-nodeintermittently failed the audio check with a timestamp gap up to the next 1 s group (seen again on 2026-10-24 in run 40094095832, where the Opus or AAC rendition jumped from about 200 ms to 1024 ms).Cause. The Rust publisher imported with
--max-age 1s. A track's max-age caps every subscriber's max delay, both at the relay and in the subscriber's own@moq/nettrack, so the native JS audio reader's 5 s budget (AUDIO_MAX_DELAY, added in moq-dev/moq#6284 for exactly this startup lag) was really 1 s. ffmpeg writes 1 s fMP4 fragments, so each audio group lands as one burst. A reader joining with one group of backlog is served the oldest group while it sits about 980 ms behind the live edge; as soon as the next group lands it is 1 s behind, goes stale, and is cut mid-read. The Container consumer reports a gap, the subscriber moves to the next group, andtone.pyfails the discontinuity.This was the Node subscriber's own track layer and the relay dropping the group correctly by the 1 s budget the publisher declared, not a delivery bug. In the reproduced failures the relay finished every group (
finished group sequence=0); the reader's local track expired group 0 when group 2 landed about 40 ms after group 0 started serving. Only the Rust publisher sets a max-age (the FFI publishers keep hang's 30 s), which is whypython/go/cpp -> js-native-nodenever failed.Fix. The fMP4 publisher keeps its media 5 s (
--max-age 5s), covering the longest reader budget: the native JS audio reader and the wire-compat JS reader both ask for 5 s. The comment atAUDIO_MAX_DELAYnow says the publisher's max-age caps it. Since moq-dev/moq#6636,--max-ageno longer extends how long a finished import of the current CLI stays up, so this costs it no shutdown time. A released CLI in the wire-compat lanes still stays up for its max-age, now 5 s, withinstop_publisher's 10 s. The comment above the import said a finished import stays up for its max-age, which that change made stale; it now names the linger.Reproduction
A loop outside the checkout: the relay, the Rust CLI fed by the same ffmpeg fMP4 command as
interop.sh, andsubscribe.tsunder Node on moq-lite-07-wip, judged bytone.py, with 72 busy loops on a 24-core machine.The real harness (
interop.sh --publishers rust --subscribers js-native-node,js-native-bun) then passed 4 of 4 runs under 48 busy loops.The
broadcast discovery failed ... connection error: closedline in the failing log is unrelated: it prints on every native JS run, passing ones included, as the session closes.Public API and wire impact
None. Test harness only.
Checks
interop.sh --publishers rust --subscribers js-native-node,js-native-bun, 4 runs under load.just test interop --publishers rust --subscribers js-native-nodeafter merging main.just checkpassed.Chosen without asking (please review)
avc3path keeps--max-age 1s. It has no gap check, and its readers ask for 1 s.Follow-ups
WARN publisher 'rust' was still running 10 s after it was stopped; killing it(seen in the post-merge run here; the round still passes). The fix isimport --linger, which released CLIs in the wire-compat lanes refuse, so it needs a capability check. Not done here: a different problem from the audio gap.broadcast discovery failed ... connection error: closedon every clean exit, which reads like a failure in triage.(Written by Claude Opus 5.5)
🤖 Generated with Claude Code