Skip to content

fix(net): a redialed lite-07 session syncs once the doubt lets its routes in - #8890

Merged
kixelated merged 3 commits into
mainfrom
fix/routes-sync-past-doubt
Nov 16, 2026
Merged

kixelated merged 3 commits into
mainfrom
fix/routes-sync-past-doubt

Conversation

@kixelated

@kixelated kixelated commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Routes::poll_synced promises that once synced, a prefix not announced is not announced. On moq-lite-07 that broke for a redialed session. When a session closes, the node doubts its far end for a second, and a session to that node opened since the doubt began waits it out before the node takes a route that begins there (moq-dev/moq#8731). The announce stream let go of its snapshot at SYNCED regardless, so a consumer reading a redialed peer read synced at once with none of that peer's routes, and only saw them a second later.

Approach

  • route::path::Router::doubted(peer): whether the peer offers a route that only doubt keeps the node off, for a key with no live route. It shares hopes's predicate, now kept_off.
  • route::node::Stream::poll_undoubted: ready once the stream's peer offers no such route. It rechecks whenever the node's next deadline moves, which a lifting doubt does, so it needs no polling.
  • The lite-07 announce stream lets go of its snapshot after SYNCED only once poll_undoubted is ready, with what the node served meanwhile already in the origin. A route that only doubt holds back thus keeps the consumer unsynced until the doubt lifts and the route shows.
  • Only the initial set waits: once the snapshot is gone, a later doubt is news, as before.

Impact

  • Public API: none. poll_synced's doc now says a lite-07 redial waits out the doubt.
  • Wire: none.
  • Behaviour: on lite-07, a consumer fed by a session redialed to a node in doubt syncs up to the doubt's second later (Doubt::DEFAULT), with that peer's routes shown. js/net casts no doubt, so it has nothing to mirror.

Validation

  • New synced::a_redial_syncs_once_the_doubt_lets_its_routes_in: on main it fails with left: {} / right: {"a"}; with the fix it passes. read_until_synced now checks sync whenever no event is ready, since it used to block on the next event and so could not catch a consumer that synced early.
  • just ci: 12805 tests pass.
  • The route rule is unchanged, so the model needs no change; verify-route's coverage row names kept_off. Flap.cfg (doubt and a returning link) simulates clean: 1000 traces, 600305 states.
  • A downstream service whose "whole view" waits on poll_synced before vouching for its list failed its redial test on main (it read whole with an empty list) and passes with this change on the same base.

Caused by

  • moq-dev/moq#8731 - put lite-07 sessions on the path router, whose doubt holds back a redialed peer's routes, while the announce stream still released its snapshot at SYNCED (found by check)

Alternatives

  • Lift the doubt for the redialed session's own routes: rejected, since it is what damps a flapping link (a_flapping_link_keeps_a_dual_homed_publisher_routed).
  • Let consumers tolerate up to a second of a synced view missing routes: rejected, since it changes what "synced" means for every reader.

Follow-ups

None.

Models

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

🤖 Generated with Claude Code

(Written by Claude Opus 5.5)

Review

Rewritten by quest review after each round.

  • Head: 2997f68

  • Base: origin/main at 1099279

  • 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, medium effort

  • Session: 01a1e361-187e-7d03-af64-ad5b14d7f42e, round 1

  • Score: 9/10, No actionable defects were found: snapshot release follows doubt resolution and drains resulting outputs before reporting synced, but validation was source-only with no builds or tests run.

  • Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

kixelated and others added 3 commits November 15, 2026 23:43
…utes in

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…_off

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review November 16, 2026 08:03

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

Reviewed changes

This review covers the whole PR: lite-07 now keeps its announce snapshot past SYNCED until no route from the peer is kept out only by doubt.

  • Router::doubted / kept_off: The new kept_off predicate is hopes's old closure, unchanged. doubted(peer) applies it to every key the peer sent that has no live route.
  • Stream::poll_undoubted: This rechecks whenever poll_deadline reports that the deadline changed. It cannot spin: Locked's Drop republishes timer from router.deadline() on every unlock, so the armed value read under the lock always matches the published timer.
  • Snapshot release in AnnouncePrefix: SYNCED no longer drops the snapshot. The end of the Run arm drops it once poll_undoubted is ready, after outputs() has served what the node queued. The release only happens inside run.routed, but has_routes() and has_synced() cover the same versions, so versions before lite-07 keep their own release points.
  • synced integration test: The new redial test now checks sync whenever no event is ready, so a consumer that syncs early is caught. SETTLE goes up to 2s to cover Doubt::DEFAULT.

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

@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The router now reports when a peer’s heard route is excluded by doubt. The lite subscriber keeps its snapshot after SYNCED until routed state reports that routes are undoubted. Duplicate SYNCED messages are rejected. The integration test checks that a route synchronizes again after the session is closed and redialed.

Merge Risk: Low · up to 2997f

The change makes a redialed session wait out the node's doubt before reporting synced, which fixes the reported empty-view case. In a narrow multi-stream case, a route served through another stream can still appear just after the synced signal. This is transient and self-correcting, so it can be handled as a follow-up.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: a redialed lite-07 session now syncs only after the doubt lets its routes in. The raw summary confirms the changeset does this: AnnouncePrefix retains the snapshot until ro…
Description check Passed The description covers the problem, the approach (Router::doubted, Stream::poll_undoubted, and the lite-07 announce stream change), the impact, validation, and alternatives. Each part matches the raw …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change: a redialed lite-07 session now syncs only after the doubt lets its routes in. The raw summary confirms the changeset does this: AnnouncePrefix retains the snapshot until routed.poll_undoubted is ready, and Router::doubted and Stream::poll_undoubted are added. The title is specific and matches the main fix.

Full details: Description check

Explanation

The description covers the problem, the approach (Router::doubted, Stream::poll_undoubted, and the lite-07 announce stream change), the impact, validation, and alternatives. Each part matches the raw summary, so the description is on-topic and detailed.

Finishing Touches

Simplify code

  • Commit to this branch
  • Create a new PR
  • 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

Recent review info

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: e7efccfb-ca43-430b-af5c-014a30b81000
Commits

Reviewing files that changed from the base of the PR and between 1099279 and 2997f68.

Files selected for processing: 7

  • .claude/skills/verify-route/SKILL.md
  • rs/moq-net/src/lite/subscriber.rs
  • rs/moq-net/src/lite/subscriber/routed.rs
  • rs/moq-net/src/model/origin.rs
  • rs/moq-net/src/route/node.rs
  • rs/moq-net/src/route/path.rs
  • rs/moq-net/tests/integration/synced.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.

@kixelated
kixelated added this pull request to the merge queue Nov 16, 2026
Merged via the queue into main with commit 80ca978 Nov 16, 2026
7 checks passed
@kixelated
kixelated deleted the fix/routes-sync-past-doubt branch November 16, 2026 08:39
kixelated added a commit that referenced this pull request Nov 16, 2026
Takes in Above (#8827) and the redialed session's doubt-gated sync (#8890) on
the single Announce Stream:

- A narrowing carries a claim covering the new prefix from above with its Above
  grown by the segments between (`lite::rekey::Claim::lowered`, rekey.ts), on
  both ends, and the draft's Edits section says so.
- The lite-07 subscriber releases its synced snapshot only once nothing the peer
  offers waits on doubt (`Routed::release` polls `Stream::poll_undoubted`).
- `a_claim_above_its_path_counts_from_the_sessions_root` runs on the route
  stream harness (`prefix_on`) rather than the pre-lite-07 announce prefix.

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