Repository navigation
fix(net): a lite-06 relay's fall back onto a worse path waits out the update hold - #9554
Merged
Merged
Conversation
… update hold Each lite-06 session mints its own instance for a path, so a relay moving its best route onto another session's worse path to the same publisher reported a restart, which skipped the update hold and the retraction quarantine. Lite-06 sends a restart as Ended then Active, so each step of a withdrawal's path hunt restarted the broadcast at every relay downstream: one withdraw on a 24-relay lite-06 mesh sent 47467 announce messages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated
marked this pull request as ready for review
November 24, 2026 18:50
Contributor
|
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 7 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Nightly run 45242597151 failed
mesh_sweep::benchmark_route_meshon the moq-lite-06 mesh with 24 relays:Withdraw client 0: room/1sent 47467 announce messages, over the budget of 31232. TheOriginRestartnamed first in the panic is only the first entry in that case's log. Every withdraw in that case hunted: 12027, 24277, 23377, and 47467 messages, each taking about 4.2 s of simulated time. The failure is deterministic and reproduces onmain.Root cause: each lite-06 session mints its own instance for a path, because the wire carries none. When a withdrawal removes a relay's best route, the relay falls back to another session's stale, worse path to the same publisher. Since the instance differs, its announce cursor delivers that fall back as a
Restart, and a restart skips both lite-06 churn mitigations: the 300 ms update hold holds only updates, and the 2 s retraction quarantine matches only on the same instance. The lite-06 publisher sends a restart asEndedthenActive. The downstream relay retires its minted instance, mints a new one, and restarts in turn, so every step of the hunt floods the mesh. Raising the hold to 2 s changed nothing, message for message, which is how this was pinned down.Approach
All of it stays in
lite06_churnand touches only hop-chain routes:Restartwaits out the update hold when it falls back from the route delivered at a prefix onto a strictly worse path (cost, then chain length) to the same publisher (first hop), with both instances minted (lite06_churn::falls_back). It is still delivered as a restart, so no identity is merged across sessions. A replacement session ranks the same and another publisher names another first hop, so both still restart at once, andreplacement::minted_*keeps passing.lite06_churn::same_stream). It already required the same publisher and a strictly worse rank.OriginConsumerState::deliveredkeeps the delivered route's publisher and rank next to its instance (Delivered). The hold's anchoring moved intoPending::hold, which both arms share.Measured with
benchmark_route_mesh(fixed seeds, 16 cases per size), max messages for one change on moq-lite-06, before → after:At every size, lite-06 now costs about what lite-07 does (lite-07 at 24 relays: withdraw 150, relay_restart 2648). lite-07 rows are unchanged.
Impact
mesh_withdraw's cluster now shows[End]on lite-06 too, where it showed[End, Start, End]. A real restart by the same publisher onto a worse path is delivered up to 300 ms later, the price an update already pays. A restart at the same rank, or by another publisher, still goes at once.Alternatives
Updatethat keeps the minted instance. Rejected: lite-06 can't tell a move from a restart, and keeping the instance across one would give a restarted broadcast its old identity, asresidual_late_better_path_restarts_on_lite06explains.replacement::minted_lite06).Follow-ups
None.
Validation
628ff8199d..b29b90be29. The first failing commit is moq-dev/moq#9404, which added lite-06 to the benchmark. Its parent, given fix(net): a relay keeps the route in use on a tie instead of picking by hash #9404's lite-06 harness, fails the same case (34412 messages), so fix(net): a relay keeps the route in use on a tie instead of picking by hash #9404 only exposed the bug.moq-lite-06, 24 relays, case 0) costs at most 1102 messages per change, and withdraws 185–319. The wholebenchmark_route_meshpasses (table above).just route-sweep's mesh sweep from fresh seedMOQ_ROUTE_SEED=774211505, 500 cases under both versions: pass.cargo test -p moq-net --features async: 3775 unit and 651 integration tests pass.just checkpasses.a_changed_route_waits_out_the_holdanda_retraction_quarantines_a_named_publishernow also run on minted instances, and the first checks that another publisher still restarts at once.mesh_withdraw::cross_node_close_retracts_once_lite06(3 rounds, every relay ends once).cross_node_close_reannounces_on_lite06_without_the_holdkeeps the old residual pinned with a zero hold, as the negative control.js/netcounterpart: the JS origin has no update hold or quarantine.Caused by
benchmark_route_mesh, exposed when moq-dev/moq#9404 measured lite-06 meshes)Decisions
Models
Size: S
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: f0d73a0
Base: origin/main at 5d86f05
Risk: medium,
It is a bug fix in the Rust relay's route delivery (rs/moq-net origin.rs): a lite-06 fall back onto a worse path to the same publisher now waits out the update hold, and a switch between another publisher's broadcast restarts at once. Nothing public, wire format, or config key changes (the Config field is crate-private), so a relay that relies on the old timing could see a delayed announce for up to 300 ms, and a revert of this commit range fully undoes it.Classified: medium by Claude Code, claude-haiku-5-5, low effort, session
8eb3bee8-2525-4c0a-80fc-68cad995e0eeReviewer: Codex, gpt-6.1-sol, medium effort
Session:
01a20ee3-395e-7702-9893-ef95899d38da, round 1Score: 9/10,
Code inspection found no actionable defects or dependents on the old contracts, though builds and tests were not run as instructed.Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none
Reviewer: Codex, gpt-6.1-sol, high effort, shadow
Session:
01a20ee3-395e-7fa3-8d9a-8b5783dc9de4, round 1Score: 9/10,
The change appears sound by inspection with no actionable regressions, pending runtime validation because builds and tests were not run as instructed.Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none