Skip to content

test(net): a refused replacement keeps a withdrawn incumbent open - #8471

Merged
kixelated merged 3 commits into
mainfrom
test/withdrawn-incumbent-main
Nov 11, 2026
Merged

kixelated merged 3 commits into
mainfrom
test/withdrawn-incumbent-main

Conversation

@kixelated

@kixelated kixelated commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

On release, a publisher's withdrawal that reaches a relay before the serving route delivers the track's end can end a subscriber's track with Unroutable: the front switches to a stale standby route whose peer already dropped the broadcast, and the standby's refusal aborts the track before the withdrawn copy's clean end arrives. moq-dev/moq#8469 fixes that on release. main already behaves correctly but has no test for the race.

Approach

Add a_refused_replacement_keeps_a_withdrawn_incumbent_open to rs/moq-net/src/model/origin.rs, the same scenario as the release fix's test, on main's simulated-clock harness: the serving route is withdrawn and its source closes while the subscription is open, the standby refuses the track, and the subscriber must still read the withdrawn copy's last group and its clean end.

It passes on main. It also still passes with Front::refuse's draining branch disabled: the front then aborts the logical track, yet the reader already on the withdrawn copy still gets its last group and clean end. The test therefore pins the end-to-end behavior, not that one branch.

Impact

  • Test only. No public API, wire, or behavior change.

Alternatives

None: it mirrors the release test so both branches pin the same scenario.

Follow-ups

None.

Caused by

No bug on main; the release fix is moq-dev/moq#8469.

Checks

just check origin/main (Nix dev shell) passes.

Models

Size: S
Implementer: Claude Code, claude-opus-5-5, unknown effort

Review

Rewritten by quest review after each round.

  • Reviewer: Codex, gpt-6.1-sol, medium effort
  • Session: 01a1c7d3-9129-71a0-a89a-02de01ad32e3, round 1
  • Head: 824f30b
  • Base: origin/main at d7699f8
  • Score: 9/10, The diff adds only a regression test for retaining an incumbent track after a replacement refuses it, with no actionable defects identified, pending CI confirmation because builds and tests were not run as instructed.
  • Findings: none

🤖 Generated with Claude Code

(Written by Claude Opus 5.5 with high effort)

kixelated and others added 3 commits November 10, 2026 14:23
Regression test for the release-only unroutable race (fixed on release in
fix/withdrawn-incumbent-release); main already passes it. Not yet run here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review November 10, 2026 23:39
@coderabbitai

coderabbitai Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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 35 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d2e9541e-0b35-41b3-8d6a-fc0b82fcb08a
Commits

Reviewing files that changed from the base of the PR and between d7699f8 and 824f30b.

Files selected for processing: 1

  • rs/moq-net/src/model/origin.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)

Reviewed commit 824f30b.

No actionable findings. The test exercises withdrawal, standby refusal, continued incumbent delivery, and clean completion on the simulated-clock harness. Its scope is correctly described as end-to-end behavior rather than proof that Front::refuse's draining branch ran; the PR explicitly documents that mutation limitation. No production behavior changes.

Overall direction: the change is focused and consistent with its stated purpose.

Verification limits: GitHub-only static review of the full diff and relevant context. No builds or tests independently run.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ One optional strengthening inline — the test itself is sound.

Reviewed changes

  • a_refused_replacement_keeps_a_withdrawn_incumbent_open (rs/moq-net/src/model/origin.rs) — a new #[kio::test] that withdraws the serving room route while its open copy of room/alice's video track is being read, has the standby route answer the broadcast and refuse the track with Unroutable, then asserts the incumbent's remaining group and its clean end still reach the subscriber.

Verified: the test passes, and the body's own caveat holds — with Front::refuse's draining branch removed it still passes, because the reader already attached to the withdrawn copy drains it either way. There is no duplicate coverage; this is the only test that withdraws a serving route with a subscription open.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

Comment thread rs/moq-net/src/model/origin.rs Resolved

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Re-reviewed at 824f30b (the head has not moved since the prior review, so no commits to re-examine). The prior inline finding on the post-refusal yield_now loop is declined in the thread and settled; the test is a deliberate end-to-end assertion, not a proof of the drain branch. Re-ran the test on the simulated clock: it passes. No new issues, no production or API change.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 11, 2026
Merged via the queue into main with commit 1ccc925 Nov 11, 2026
12 of 13 checks passed
@kixelated
kixelated deleted the test/withdrawn-incumbent-main branch November 11, 2026 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant