Repository navigation
test(net): a reader leaving after the cache window keeps the relay's latest group - #4923
Conversation
…latest group Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review. WalkthroughAdds a paused-time test across five protocol versions. The test checks that new readers receive the same sequence-0 catalog group shortly after a reader leaves beyond the default cache expiry and after that reader’s front lingers and releases the track. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to No merge-blocking issue is identified in this test change. Merge after the pending CI checks complete. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
|
Automated review of This adds one regression test, Checked
Non-blocking
CIWindows and Android passed. Check, Test, macOS, and WASM are still queued on Verdict: MERGE once CI is green. This is an automated review, not the maintainer's decision |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Re the automated review:
(Written by Claude Opus 5.5) |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit a5f6373.
No new actionable correctness finding on the updated head. rs/moq-net/tests/rejoin.rs:361-379 uses separate client hops and keeps an independent holder subscribed, isolating the relay copy; :385-401 now checks both immediately after the leaver disconnects and after its linger expires. That closes the earlier coverage suggestion without a wall-clock test. The outer budget (TEST_TIMEOUT + 3 * DEFAULT_EXPIRY) covers the 60s + 100ms + 31s paused-time sleeps with margin. Payload and sequence assertions verify usable retained content, not merely an announcement. Direction is sound and narrowly test-only. IETF rows are extra coverage, not evidence of reproducing the historical lite regression. Static review only; I did not independently rerun the old/fixed revision comparison. Current head is mergeable with Check/Platform/Android/WASM queued.
Head, state and existing reviews rechecked before posting.
Merge current main and match the neighboring deterministic simulation tests. Co-Authored-By: GPT-6 <noreply@openai.com>
kixelated
left a comment
There was a problem hiding this comment.
Independent foreground Codex review of 1376c4a.
No actionable findings. Reviewed the added test and its mechanical moq_net_sim port after merging main. Independent client hops and a held subscription isolate the relay's shared latest group. Fresh readers assert both sequence and payload immediately after leave and after the leaver front's linger. Simulation timers preserve the original timing scenario without wall-clock sleeps. IETF rows remain extra coverage, not a claim of reproducing the historical lite bug.
Validation: merge agent reports all 1,550 moq-net tests passed, including the new regression. Broader local checking hit an unchanged main burst-drill activation failure; replay did not reproduce it, and an unchanged-main workload exposed shared io_uring MEMLOCK limits. Those limitations remain documented, with no retry workaround in this PR. New-head CI is pending and must pass before landing. Test-only; no public API or wire change. Release backport remains separate.
(Written by GPT-6)
|
Validated head Local moq-net testing passed all 1,550 selected tests, including this regression. The scoped lint/compile gate passed. Full The exact-head OpenAI review has no findings. This merge covers the regression test; a release backport remains separate work. (Written by GPT-6) |
|
Final-head Test is now green alongside Check/Android/Windows/macOS/WASM. The reviewed head remains The maintainer approved normal squash merging under the current repository rules, which have no merge queue configured. (Written by GPT-6) |
Co-Authored-By: GPT-6 <noreply@openai.com>
kixelated
left a comment
There was a problem hiding this comment.
Foreground Codex review of 9a4281b. Both regressions are retained: main's rejoin-during-cancel test and the contributor's idle-leave retained-latest test. The contributor's 82-line test is unchanged from the previously reviewed head; the complete PR diff against current main is exactly that addition. Independent hops, the holder, immediate/post-linger sequence and payload assertions, and simulation time are preserved. No actionable findings in the resolution. Local and CI gates must pass before landing. Test-only; no public API or wire changes.
(Written by GPT-6)
A front that parks a track adopts the relay copy's groups into a warm copy, sharing their producers. Once the warm copy ends, expire_closed aborted every idle group, including the latest group the relay's live copy still serves, so new subscribers skipped it and waited for a group that a steady catalog never writes. Abort only groups the ended track alone owns. Ports #4923's regression test to release's rejoin.rs on tokio's paused clock. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve every conflict to main's side, which already carries each release change: - Cargo.toml/Cargo.lock: keep main's moq-noq 2.0.2 stack over release's 1.3.4 pins (#5072). - LOCATION_FILTER (Rust and JS): keep main's #5080 on its Encoder/Decoder API over the release backport (#5094). - model/track.rs, cache.rs, group.rs, tests/rejoin.rs: keep main's expire_closed with no live-edge protection count; main has no warm_copy and #4923 already carries the regression test (#5100). - quest/m0/release-22: keep main's retirement of the finished children. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
On moq-net 0.3.10, a relay loses a track's latest group when a downstream session that read the group leaves after it has gone unread for longer than the cache's idle expiry (30 s by default). Every reader that joins afterwards waits for a newer group. FETCH still works, because it misses the cache and goes upstream. A catalog that rarely changes hits this whenever a client that read it restarts. An external consumer (OneTooMany) hit it on a catalog track.
How it happens on 0.3.10 (lines at
4810d476e):warm_copy(model/origin.rs:2257) moves the cached groups onto a new local track withadopt_group, which shares the relay copy'sgroup::Producerrather than copying it.expire_closed(model/track.rs:757-772) then aborts the idle latest group withError::Old.#4741 (
0382d309f) fixed it as a side effect by deletingwarm_copy. No test covers the case.Approach
Add
leaving_after_the_cache_window_keeps_the_latest_grouptors/moq-net/tests/rejoin.rs. It connects a publisher, a relay and four client sessions over mock sessions on deterministic simulation time.cache::DEFAULT_EXPIRY, and disconnects.Each client has its own hop, because sessions sharing a hop share one relay front, and then the bug doesn't show.
The test fails on
4810d476e(moq-net 0.3.10) and on0382d309f^(moq-lite-05: the later reader never got the latest group). It passes on0382d309fand on main. The same scenario as a standalone test failed over lite-05, lite-06 and lite-07-wip and passed over moq-transport-17. The IETF drafts stay in the version list for coverage, like the neighbouring tests.Impact
Alternatives
moq-relayover QUIC reproduces it too, but it runs on the wall clock. Mock sessions on simulation time are deterministic.Follow-ups
releasefix could makewarm_copycopy groups instead of sharing them with the live copy, but that is untested. Whether to backport, and how, is the maintainer's call.Validation
9a4281ba05e9eafaf68073f921170bba77431983. Merged current main and kept its cancel/rejoin regression alongside this unchanged 82-line addition.nix develop --command just rs test -p moq-net: all 1,560 tests passed, including both rejoin regressions.just check: 5,091 Rust tests passed; one unchanged moq-uring setup failed at the host's shared 8,192 KiBRLIMIT_MEMLOCK, with 197 tests canceled. This is not a clean broad-suite pass.(Written by GPT-6)