Repository navigation
feat(relay)!: expose outbound peer transport and connect history - #7776
Conversation
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Key outbound peer history by dial identity and retire it only when the peer leaves the dial set, so a cost or credential change that restarts the dial no longer resets `last_connected_seconds_ago` to null. The dial registers when its task is built, so a peer is listed before its first attempt, and it no longer takes a `conn` id. Document `node` as the peer's identity and record the `/nodes` and `Observation` changes in MIGRATE.md. 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 26 seconds. 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. |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed head: 192d3a1.
No actionable finding. Peer history is registered before dialing, survives a cost or credential replacement, and is removed with the dial-set entry. The monitor publishes transport and last-connect time coherently with lifecycle revisions, including a short session missed between observations; the readiness consumer counts live connections rather than entries. LAN labels avoid the credential-bearing dial path.
Verification: static GitHub inspection of the registry, dial lifecycle, monitor, endpoint and tests. I did not run the tests, cluster drill or real transports.
(Written by review (OpenAI))
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
/nodesregistry rewrite —Nodesnow keys every configured outbound peer by itsDialTargetidentity, tracks live(conn id, Transport)sessions per dial, and keepslast_connected, so disconnected and retrying peers are listed and history survives failed attempts and a dial replaced for a new cost or credential.- Dial ownership and retirement — the
dialerregisters a peer before its first attempt;Mesh::applyretires history only for peers no longer in theDialMap, andDrop for Meshclears the shared registry on shutdown. - Coherent lifecycle observation —
run_remote_sessionnow drivesmonitor.state()/state_changedinstead ofreconnect.status(), recording transport and last connect from the same revision, including a connect+disconnect that lands between polls. moq-tokioAPI —Stateretainslast_connected; publicObservationaddslast_connectedandtransport, with migration notes in bothMIGRATE.mdfiles.- Snapshot labels — canonicalization strips userinfo/query/slashes and merges identities sharing a label, removing the LAN peer's credential-bearing
/.cluster/<credential>path from the endpoint. - Tests/docs/drill — new unit and integration assertions, docs for
/nodes, and an updatedpeer-link-never-redialedmutation;git apply --checkon that patch succeeds.
Invariants I verified: Nodes keys are exactly DialTarget.key, the same identity DialMap stores, so the retain predicate cannot drop a live dial; a nonempty connections always pairs with Some(last_connected) because Shared::connected writes both in one revision; and the monitor loop wakes on a superset of the old status changes while still terminating through terminal.
(Written by deepseek/deepseek-v4.1-flash-1017)
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
# Conflicts: # rs/moq-relay/MIGRATE.md

Problem
Operators cannot distinguish a never-connected outbound peer, a failed redial, and a WebSocket fallback from
/nodes. The endpoint forgets peers as soon as they disconnect.Approach
Impact
/nodesincludes disconnected configured peers with an emptyconnectionsarray. Consumers counting live peers must filter for nonempty connections. Live connections addtransport; peers add nullablelast_connected_seconds_ago, which remains null until their first successful handshake and is forgotten when the peer is removed. Recorded inrs/moq-relay/MIGRATE.md.nodeis its mDNS identity instead of the first dialed address, whose/.cluster/<credential>path exposed its credential on this endpoint.connection::Observationaddstransportandlast_connected. Struct-literal consumers must supply them; recorded inrs/moq-tokio/MIGRATE.md. No media wire or CLI changes.Alternatives
Journal parsing depends on retention and log formatting. A second peer registry endpoint would duplicate ownership and identity already present in
/nodes.Validation
324e34fe2dd2d083094a74e44c6046842017ffff:just rs check-test -p moq-relay -p moq-tokiopassed (1024 tests, 30 skipped).192d3a166fce12419f6c0430e304b2a9d2defd0c:just rs check-test -p moq-relay -p moq-tokiopassed (1013 tests, 30 skipped, clippy enforced),just fix origin/mainleft no changes, andtest/drill/sensitivity.sh --apply-onlyapplies 7 of 7 mutations. Earlier,24924821dfpassedjust cion nixos2.Review
Claude Code / claude-opus-5-5 / medium (
quest review --harness claude; the code is GPT-6.1 Sol's), sessionb28194e4-bc74-41b1-9b24-0844e4c33081.0c372490c2: 3 findings.dialer, and retired byMesh::applyonly when the peer leaves theDialMap. Dials no longer consumeconnids. Covered bymesh_keeps_peer_history_until_the_peer_is_removed./nodessemantics change: fixed in both MIGRATE.md files.DialTarget::from_lan_peer).192d3a166fce12419f6c0430e304b2a9d2defd0c: no findings.324e34fe2dd2d083094a74e44c6046842017ffffmergesorigin/mainwith no new review round. The only conflict wasrs/moq-relay/MIGRATE.md, where refactor(relay)!: poll admissions and configure stats in cluster Options #7673's Unreleased entry sits beside this PR's, and both are kept.git diff origin/main...HEADhas the same added and removed lines as at192d3a1.just rs check-test -p moq-relay -p moq-tokiopassed: 1024 tests, 30 skipped.Follow-ups
None.
(Written by Claude Opus 5.5)