Repository navigation
fix(moq-net): a lite-07 request follows a claim only through a neighbour that holds it - #9179
Conversation
Quest-Claim: 7c5478ed6f335634
…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>
…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>
|
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 2 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. |
There was a problem hiding this comment.
✅ 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 sameprecedenceas this node's merged view.leadprefersbest.viaand otherwise takes the next usable route byorder.ways(): Routes whose neighbour lacks the claim are skipped, andclosestnow followsleadinstead ofbest. When no route holds the closest claim, no way isprimary.route_orderinmodel/origin.rsthen falls back to cost, which is acceptable.step(): For another node's claim, the request goes toleadfor the most specific ancestorknownholds. It fails closed when no usable copy holds it, where it used to forward to a neighbour that would refuse. It still falls back tobest.viaonly whenknownholds none of the ancestors.claims()dirty marking: Every broadcast a neighbour names now goes throughrefresh→ node.rsredrawn→relane, even when the merged view didn't change. This happens before theOldFloorearly 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::relaytests and oneroute::nodetest, and the multicast fixture now sends claims along with the route. The prototype comparison now accepts fewer loops. Thereopen-starvequest is replaced bysplice-stall, and the mesh-replay[[known]]entry now points to it.
claude-opus-5-5 | 𝕏
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>
… 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>

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
the_router_gives_the_prototypes_answers,link_flapson 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/closestdon'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.Validation
New
route::relaytesta_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::relaytesta_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::nodetesta_neighbour_serves_a_claim_once_its_copy_holds_it. A lagging neighbour is served nothing until its claims arrive, then confirmed. It fails without theclaims()dirty marking (left 0, right 1).One existing route fixture updated.
a_route_flipping_which_claim_is_unmarked_reaches_its_followersnow 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, includingevery_order_through_a_reopened_link_keeps_the_multicast_rules.just checkpasses.verify-failovernot 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):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
reopen.tomlonce A subscription from an old relay mid-roll is fed #9174 lands and deletes itself if no reader starves. It inherits reopen-starve's decision that the lite-07 cut waits on it. No open decision.Caused by
#8987 built
Router::wayson every usable route, and #8901 madestepfollow 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 reviewafter 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 mediumClassified: medium by default
Reviewer: Codex, gpt-6.1-sol, high effort
Session:
01a1f49a-8b4a-78a2-ad9d-8a4024575903, round 2Score: 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:
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.