Repository navigation
fix(net): a restarted publisher wins over its lingering session on release - #6697
Merged
Merged
Conversation
…lease Backport of #6452. A publisher that restarts without a clean close leaves its old session on the relay until QUIC idles it out, and the restart announces the same path under a new first hop. route_order hashed both, so the dead session kept the path half the time and every viewer of that broadcast waited on it. Only a route a cluster peer forwarded is hashed now; one that entered here falls through to the newest announcement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Collaborator
Author
|
Merge summary: no changes made by the merge pass. Codex reviewed head (Written by Claude Opus 5.5) |
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.
Backport of #6452 to
release, using the approach from #6435.Problem
A publisher that dies without a clean close (SIGKILL, a dropped uplink) leaves its session on the relay until QUIC idles it out. The restarted process announces the same path under a new first hop.
route_orderhashes both routes before the newest-announcement tiebreak, so the dead session keeps the path about half the time. The hash is per path, so every viewer of that broadcast lands on the dead session. Theircatalog.jsonrequest waits until the old session idles out. Through a cluster hop the downstream relay fails the same way, because the origin relay picks the dead route for the peer's upstream too.End to end with
moq-relay0.17.5,ffmpeg | moq import tsSIGKILLed and restarted at once, then a burst of 8 to 13 viewers per step, 6 steps per run:main(with #6452)Change
route_orderhashes only routes a cluster peer forwarded (RouteEntry::peer). No other node ranks a route that entered on this relay, so convergence does not need the hash there. Such a route now falls through toReverse(entry.id), and the newest announcement wins as soon as it lands.main's #6452 keeps the hash for a local prefix claim, to preserve per-path spreading of a directly connected pool.releasekeys the hash on the route's own prefix and has no per-path spreading, so thepeerflag alone is the equivalent condition here.Side effect: at an otherwise exact tie, a route that entered here beats a peer-forwarded one (hash 0 versus a hash). A peer route's chain is at least one hop longer, so this only matters for an exact tie.
Tests
restart_while_the_old_session_lingers_wins(newrs/moq-net/tests/restart_lingering.rs): the old session goes silent, the publisher restarts under another hop, and a viewer subscribes. It runs both hop orders on moq-lite-06, moq-lite-07-wip, and moq-transport-22. It fails onreleasewithmoq-lite-06 (1 -> 4): subscribe hung.a_reconnect_under_a_new_hop_wins_over_the_old_session(origin unit test, from fix(net): a reconnecting publisher wins over its lingering session on release #6435): covers named ([10]/[11]) and relay-stamped ([10, 0]/[11, 0]) reconnects in both orders.just check origin/release: passed.Impact
Route::costdoc comment changes, to describe the new ordering.js/netis unchanged: a JS origin never ranks a relay's routes.(Written by Claude Opus 5.5)
🤖 Generated with Claude Code