Skip to content

fix(net): a lite-06 relay's fall back onto a worse path waits out the update hold - #9554

Merged
kixelated merged 1 commit into
mainfrom
fix/lite06-fall-back-hold
Nov 24, 2026
Merged

kixelated merged 1 commit into
mainfrom
fix/lite06-fall-back-hold

Conversation

@kixelated

@kixelated kixelated commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Nightly run 45242597151 failed mesh_sweep::benchmark_route_mesh on the moq-lite-06 mesh with 24 relays: Withdraw client 0: room/1 sent 47467 announce messages, over the budget of 31232. The OriginRestart named 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 on main.

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 as Ended then Active. 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_churn and touches only hop-chain routes:

  • A Restart waits 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, and replacement::minted_* keeps passing.
  • The retraction quarantine treats any two minted instances as possibly the same broadcast (lite06_churn::same_stream). It already required the same publisher and a strictly worse rank.
  • OriginConsumerState::delivered keeps the delivered route's publisher and rank next to its instance (Delivered). The hold's anchoring moved into Pending::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:

relays withdraw leave relay_restart origin_restart
6 63 → 24 120 → 56 488 → 304 162 → 125
12 169 → 49 240 → 84 724 → 320 300 → 212
24 47467 (failed) → 355 — → 698 — → 2387 — → 1102

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

  • No public API or wire change.
  • Behavior: a lite-06 or moq-transport relay that falls back onto a worse path to the same publisher now tells its readers once, after the update hold, instead of restarting the broadcast at once. A withdrawal across a lite-06 mesh now ends once on each relay instead of reviving: 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

  • Deliver the fall back as an Update that 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, as residual_late_better_path_restarts_on_lite06 explains.
  • Hold every restart between minted instances, as the hold did before feat(net)!: routes carry an instance and a per-instance epoch #7489. Rejected: a GOAWAY replacement session would then reach readers 300 ms late, while the old handle already refuses requests (replacement::minted_lite06).
  • Loosen the harness budget or drop lite-06 from the benchmark. Rejected: the cost was real, and it was in production code.

Follow-ups

None.

Validation

  • Bisected the fixed-seed failing case on 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.
  • With the fix, the failing case (moq-lite-06, 24 relays, case 0) costs at most 1102 messages per change, and withdraws 185–319. The whole benchmark_route_mesh passes (table above).
  • just route-sweep's mesh sweep from fresh seed MOQ_ROUTE_SEED=774211505, 500 cases under both versions: pass.
  • cargo test -p moq-net --features async: 3775 unit and 651 integration tests pass. just check passes.
  • New and changed tests, each failing without the fix: a_changed_route_waits_out_the_hold and a_retraction_quarantines_a_named_publisher now 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_hold keeps the old residual pinned with a zero hold, as the negative control.
  • No js/net counterpart: the JS origin has no update hold or quarantine.

Caused by

  • moq-dev/moq#7489 - deleted the release that held an instance-less (lite-06) route's restart while minting instances per session, so every lite-06 path switch became an immediate restart that skips the hold and the quarantine (found by check: Nightly benchmark_route_mesh, exposed when moq-dev/moq#9404 measured lite-06 meshes)

Decisions

  • Decided 2026-11-24 (maintainer, /quest-merge pick): ✅ hold a lite-06 restart onto a strictly worse path to the same publisher for the 300 ms update hold, undoing the zero-hold residual moq-dev/moq#9112 accepted (rejected: keep zero-hold restarts with another flood bound).

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 review after 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-68cad995e0ee

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

  • Session: 01a20ee3-395e-7702-9893-ef95899d38da, round 1

  • Score: 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 1

  • Score: 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

… 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
kixelated marked this pull request as ready for review November 24, 2026 18:50
@coderabbitai

coderabbitai Bot commented Nov 24, 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 7 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: 27518f0d-9c6c-47e5-8619-3455ce383e20
Commits

Reviewing files that changed from the base of the PR and between 5d86f05 and f0d73a0.

Files selected for processing: 2

  • rs/moq-net/src/model/origin.rs
  • rs/moq-net/tests/integration/mesh_withdraw.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 added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit 4178d16 Nov 24, 2026
8 checks passed
@kixelated
kixelated deleted the fix/lite06-fall-back-hold branch November 24, 2026 19:39
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