Skip to content

fix(moq-net): a lite-07 request follows a claim only through a neighbour that holds it - #9179

Merged
kixelated merged 6 commits into
mainfrom
quest/m2/multicast/reopen-starve
Nov 19, 2026
Merged

kixelated merged 6 commits into
mainfrom
quest/m2/multicast/reopen-starve

Conversation

@kixelated

@kixelated kixelated commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Finishes quest/m2/multicast/reopen-starve.md.

After a lite-07 link reopens, a relay's routes to a node can arrive before its claims. A neighbour sends its route to the node first, and the claims only follow once its own session to that node delivers them. The requesting relay had already learned the claim through another neighbour, so it built a way through the lagging one, which refused the request as unroutable because it hadn't heard the claim yet. The front stranded the track. The neighbour's claims arriving later changed nothing in the requester's own view, so nothing asked again, and the reader read nothing for 75 s or more.

The quest guessed front.rs (stranded/unstrand). The instrumented replay showed the refusal comes from the route layer instead, and the front's lifecycle is untouched. It is not detour-resume's (#9154) path either: #9154 changes waiting when a source closes, and only made the strand rarer (about 1 in 14 runs instead of 1 in 5).

The fix, in route::relay::Router:

  • ways() offers a slot through a neighbour only when that neighbour's own copy of the claimant's claims holds the claim, available and of the same precedence as this node's merged view. The closest way goes through the best usable route that holds it (lead).
  • step() follows the same rule for the request's next hop. It falls back to the best route only when no copy holds any of the claim's ancestors.
  • claims() marks the broadcasts a neighbour's claims message names as dirty, even when this node's merged view didn't change. A neighbour whose copy catches up then becomes a way.

Decisions

  • Fix at the requester, not the refuser. The requester skips a neighbour whose copy doesn't hold the claim, rather than the neighbour waiting for the claim it hasn't heard. Rejected: making the neighbour wait. It can't tell a claim that is coming from one that never will, so a wait needs a timeout and leaves the reader stalled for it.
  • The prototype comparison excuses fewer loops (the_router_gives_the_prototypes_answers, link_flaps on sparse: loops 14→7). The prototype follows the route alone, so while links flap it sends requests through a neighbour that bounces them. Fewer loops is the point of the change.
  • pick/closest don't check which neighbour holds the claim. Which claim to join stays a property of this node's merged view. Only the next hop depends on the neighbours' copies. Changing the pick would move readers between Instances on claim lag.
  • No wire or public API change.

Validation

  • New route::relay test a_request_follows_only_a_neighbour_that_holds_the_claim. The best route's neighbour hasn't sent its claims, so the way and the step must go through the neighbour that has, then move back once the first catches up. Without the fix, its ways are [(Via(2), false), (Via(3), true)].

  • New route::relay test a_request_skips_a_neighbour_that_holds_the_claim_unavailable (review round 1). A neighbour whose copy holds the claim only unavailable, or in another epoch, is no way either, until its copy catches up. Without the check, its ways are [(Via(2), true), (Via(3), false)].

  • New route::node test a_neighbour_serves_a_claim_once_its_copy_holds_it. A lagging neighbour is served nothing until its claims arrive, then confirmed. It fails without the claims() dirty marking (left 0, right 1).

  • One existing route fixture updated. a_route_flipping_which_claim_is_unmarked_reaches_its_followers now sends the claims with the route, as a real session does.

  • cargo test -p moq-net: 1543 passed. All 19 ignored nightly route sweeps, searches, and benches pass in release, including every_order_through_a_reopened_link_keeps_the_multicast_rules. just check passes.

  • verify-failover not rerun: the front lifecycle (model/front.rs, model/origin.rs, model/resume.rs) is untouched.

  • Mesh replay, ring4.toml × reopen.toml × 32 broadcasts (A/B):

    Build Runs passed A strand (refused, never re-asked) Failing runs' starved paths
    Before the fix, without fix(moq-net): a reader resumes on a detour learned after its session closed #9154 7 of 10 2 runs 1, 4, 32
    Before the fix, with fix(moq-net): a reader resumes on a detour learned after its session closed #9154 10 of 14 1 run 1, 9, 16, 1
    Fix, without fix(moq-net): a reader resumes on a detour learned after its session closed #9154 7 of 10 none 187, 205 (instrumented), 3
    Fix, with fix(moq-net): a reader resumes on a detour learned after its session closed #9154 (main now) 2 of 3 none 68

    After the fix, no run strands a request. The failures that remain are a different stall. A front that switched copies on an unchanged route delivers one group every 15–25 s. In one run, a front on a link the fault never touched stalled the same way. No shaper dropped a packet. Pre-fix runs 7, 18, and 22 showed the same signature on fewer paths. The post-fix failures are wider, likely because more fronts now switch and splice at once, where before they stranded.

  • A subscription from an old relay mid-roll is fed #9174 (roll-echo-stall) is untested as the cause. Its first fix, a shared copy placing a time start, is the likely cause. Its head 879d3b1 no longer builds on main (window.rs), and its merge is being redone, so all 4 runs of that arm failed to build. In the coordinator's terms, the residual is cleared by A subscription from an old relay mid-roll is fed #9174's first fix in 0 of 0 runs, pending its merge.

  • The replay's [[known]] entry now names the follow-up below.

Follow-ups

Caused by

#8987 built Router::ways on every usable route, and #8901 made step follow the best route alone. Neither checked whether the neighbour had heard the claim behind that route. Found by check: the mesh replay (#9153).

Public API and wire impact

None. Internal to route::relay; no wire, draft, moq-ffi, or JS change.

Models

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

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

Review

Rewritten by quest review after each round.

  • Head: 17de69e

  • Base: origin/main at 1471225

  • Risk: medium, the base has no RISK.md to name what is always high or customer-facing, so every change is medium

  • Classified: medium by default

  • Reviewer: Codex, gpt-6.1-sol, high effort

  • Session: 01a1f49a-8b4a-78a2-ad9d-8a4024575903, round 2

  • Score: 10/10, The updated eligibility check fixes the starvation finding, and source review of the incremental changes found no new issues; no builds or tests were run.

  • Rounds: 2; first round 1 (medium 1); findings 1 (medium 1): fixed 1, refuted 0, open 0

  • Findings: none

  • The last round's findings, at 02db6d3:

    • Fixed: medium, rs/moq-net/src/route/relay.rs:2307: Exclude unavailable neighbour copies from eligible next hops; relay.rs:2309 now requires an available neighbour copy with matching precedence, while claims() at relay.rs:1902 marks catch-up changes dirty so node.rs recomputes serving routes even when the merged claim is unchanged.

kixelated and others added 5 commits November 19, 2026 06:20
…our that holds it

A route to a node can reach a relay before that node's claims do, so a
neighbour's route was used for a claim the neighbour had not heard yet. The
neighbour refused the request as unroutable, the requesting front stranded
the track, and the neighbour's claims arriving later changed nothing here,
so the track was never asked for again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A request no longer strands on a neighbour whose copy of the claims lags,
but the replay still starves a reader in some runs: a front that switched
copies delivers a group only every 15-25s on an unchanged route. The
replay's known entry now names that follow-up quest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title A reader reads again after a lite-07 link reopens fix(moq-net): a lite-07 request follows a claim only through a neighbour that holds it Nov 19, 2026
…m unavailable

A neighbour whose copy holds a claim only unavailable, or in another epoch,
refuses a request for it as surely as one that has not heard it. Its copy
catching up marks the broadcast dirty, so the way appears then.

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

coderabbitai Bot commented Nov 19, 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 2 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: 0016da02-ecc2-457b-92f1-c513786a20b4
Commits

Reviewing files that changed from the base of the PR and between 3bcaae7 and 17de69e.

Files selected for processing: 7

  • quest/m2/multicast/README.md
  • quest/m2/multicast/reopen-starve.md
  • quest/m2/multicast/splice-stall.md
  • rs/moq-net/src/route/node/tests.rs
  • rs/moq-net/src/route/relay.rs
  • rs/moq-net/src/route/tests/multicast.rs
  • test/mesh-replay/script.toml
  • 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 enabled auto-merge November 19, 2026 17:42

@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.

Approach: sound. The fix puts the check at the requester: Router won't use a neighbour as a way or next hop until that neighbour's own copy of the claimant's claims holds the claim. This targets the refusal's real cause, the route arriving before the claims. The alternative was to have the refuser wait for a claim it might never hear, which would need a timeout. pick/closest stay on the merged view, so readers don't move between Instances because of claim lag.

Reviewed changes

The whole diff at 17de69e. I ran cargo test -p moq-net --lib -- route:: locally: 139 passed, 19 ignored. That includes the three new tests, the updated fixture and the_router_gives_the_prototypes_answers.

  • holds / lead: A neighbour counts only if its copy has the claim available and with the same precedence as this node's merged view. lead prefers best.via and otherwise takes the next usable route by order.
  • ways(): Routes whose neighbour lacks the claim are skipped, and closest now follows lead instead of best. When no route holds the closest claim, no way is primary. route_order in model/origin.rs then falls back to cost, which is acceptable.
  • step(): For another node's claim, the request goes to lead for the most specific ancestor known holds. It fails closed when no usable copy holds it, where it used to forward to a neighbour that would refuse. It still falls back to best.via only when known holds none of the ancestors.
  • claims() dirty marking: Every broadcast a neighbour names now goes through refresh → node.rs redrawn → relane, even when the merged view didn't change. This happens before the OldFloor early return, so a lagging copy that catches up becomes a way. The extra relane work grows linearly with the claims messages received, so it stays bounded.
  • Tests and quests: There are two new route::relay tests and one route::node test, and the multicast fixture now sends claims along with the route. The prototype comparison now accepts fewer loops. The reopen-starve quest is replaced by splice-stall, and the mesh-replay [[known]] entry now points to it.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit 0c4aeed Nov 19, 2026
7 checks passed
@kixelated
kixelated deleted the quest/m2/multicast/reopen-starve branch November 19, 2026 18:51
kixelated added a commit that referenced this pull request Nov 19, 2026
Main's #9179 deleted reopen-starve and pointed its known mesh-replay entry at
splice-stall. That entry keeps this branch's event scoping (reopen-link,
reopen-relay, kill), so a roll's starved reader still fails. The roll-echo-stall
entry stays gone, and splice-stall links this PR, since the quest file goes
away with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated added a commit that referenced this pull request Nov 20, 2026
… relay sends

19 of 20 reopen.toml runs on main pass; the failure starved 2 reader paths whose
relay reset them Unroutable while still showing the broadcast. Reverting #9179
brings back reopen-starve (4 of 8 failed). Pauses match lite-06 per build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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