Skip to content

Refresh active relay clients after config changes#2

Open
azooz2003-bit wants to merge 7 commits into
mainfrom
fix/relay-config-refresh
Open

Refresh active relay clients after config changes#2
azooz2003-bit wants to merge 7 commits into
mainfrom
fix/relay-config-refresh

Conversation

@azooz2003-bit

@azooz2003-bit azooz2003-bit commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Same-URL relay configuration replacement now restarts the active relay client so rotated authorization tokens take effect without replacing the endpoint or live QUIC connections. Relay removal stops the affected client while retaining the prior advertised home until net-report selects its replacement, avoiding a transient relay-less address.

The regression test uses an auth-enforcing local relay, rotates its expected token, replaces the relay config at the same URL, and verifies token B is observed while endpoint identity, connection stable ID, and a live stream remain intact.

Verification:

  • cargo test -p iroh --lib -- --test-threads=1 (112 passed, 1 ignored)
  • cargo fmt --check
  • cargo check -p iroh --all-targets
  • cargo clippy -p iroh --all-targets -- -D warnings

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


Summary by cubic

Restart active relay clients when their config is updated at the same URL so rotated auth tokens take effect without changing the endpoint ID or dropping existing QUIC connections. Also fixes cancellation leaks in address lookup and bounds the path-open retry queue for stability.

  • Bug Fixes
    • Restart the active relay client on same-URL config updates; keep live QUIC connections and endpoint identity intact.
    • On relay removal, stop the client but keep the last advertised home until a replacement is selected, avoiding a relay-less address.
    • Cancel hanging address lookups when a connect is aborted; stop lookup once all waiters cancel and no paths/connections remain.
    • Bound and deduplicate path-open retries (max 64) to prevent unbounded growth across multiple connections.
    • Propagate relay-map changes to relay transports and wait for actor shutdown/restart so new config (e.g., auth token) is applied deterministically.

Written for commit f55ec3f. Summary will update on new commits.

Review in cubic

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@azooz2003-bit, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 46 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f9b125cc-eb86-4414-9b2d-c1f179e490ef

📥 Commits

Reviewing files that changed from the base of the PR and between 908ddf5 and f55ec3f.

📒 Files selected for processing (9)
  • iroh/src/address_lookup.rs
  • iroh/src/endpoint.rs
  • iroh/src/socket.rs
  • iroh/src/socket/remote_map.rs
  • iroh/src/socket/remote_map/remote_state.rs
  • iroh/src/socket/remote_map/remote_state/path_state.rs
  • iroh/src/socket/transports.rs
  • iroh/src/socket/transports/relay.rs
  • iroh/src/socket/transports/relay/actor.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/relay-config-refresh

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

Comment @coderabbitai help to get the list of available commands.

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