Skip to content

Replace the home-relay watchdog with in-place relay failover (flexaccess-iroh v0.0.8) - #99

Merged
andrewchen5678 merged 2 commits into
mainfrom
relay-failover
Sep 5, 2026
Merged

andrewchen5678 merged 2 commits into
mainfrom
relay-failover

Conversation

@andrewchen5678

Copy link
Copy Markdown
Contributor

Summary

  • flexaccess-iroh v0.0.3 → v0.0.8. The server-side watchdog (60 s network_change() nudge, a no-op on a stable host, then a 180 s endpoint rebuild that dropped every connection and bridge) is replaced by the crate's in-place failover, run in run_server alongside ProxyServer::run: after 60 s without a connected home relay the wedged relay is taken out of the relay map, iroh's forced net report homes the endpoint on another configured relay, and nothing is torn down. The relay is put back once a probe shows it connectable. The serve loop is a single pass again.
  • v0.0.8 also binds without the custom relays that fail the startup probe, so a process starting while a relay answers probes but refuses relay connections still comes online; create_server_endpoint returns CreatedEndpoint and the failover restores relays_left_out.
  • The crate no longer carries a rebuildable endpoint. The client's reconnect escalation (full endpoint rebuild every third failed attempt, for a wedged client endpoint after a network change) is flextunnel's own and stays: ClientEndpoint, EndpointFactory and the tolerant rebuild bind now live in transport/endpoint.rs, same semantics, tests ported.
  • Custom relays now require at least two distinct URLs; default relay mode is unchanged. Docs and AGENTS.md updated; the design is in iroh-common-architecture/relay-failover.md.
  • Version bump to 0.0.76.

Test plan

  • Linux steps of ci/unix/ci.sh: cargo clippy --workspace --exclude flextunnel-desktop --all-targets -- -D warnings, cargo test -p flextunnel-core -p flextunnel-cli (30 + 153 passed, including the two ported ClientEndpoint tests)
  • macOS / Windows / iOS xcframework: left to this PR's CI (no Xcode on this host)

🤖 Generated with Claude Code

https://claude.ai/code/session_01RZhxxjP2TA93PHNr6p1BU8

Andrew Chen and others added 2 commits September 5, 2026 09:41
…ess-iroh v0.0.8)

Adopt flexaccess-iroh v0.0.8. The server-side watchdog (a 60 s
network_change() nudge that is a no-op on a stable host and a 180 s endpoint
rebuild that dropped every connection and bridge) is gone; `run_server` runs
`relay_failover::fail_over_home_relay` alongside `ProxyServer::run`: after
60 s without a connected home relay the wedged relay is taken out of the
relay map so iroh's forced net report homes the endpoint on another
configured relay in place, and the relay is put back once a probe shows it
connectable. The serve loop is a single pass again; the `Pass` enum, the
rebuild deadline escalation and its constants are removed.

v0.0.8 also binds the endpoint without the custom relays that fail the
startup probe (a relay that answers probes but refuses relay connections
would otherwise be preferred, never connect, and keep the process from ever
coming online); `create_server_endpoint` returns `CreatedEndpoint` and the
server hands `relays_left_out` to the failover to restore.

The crate no longer carries a rebuildable endpoint, but the client's
reconnect escalation (a full endpoint rebuild every third failed attempt,
for a wedged client endpoint after a network change) is flextunnel's own and
stays: `ClientEndpoint`, its `EndpointFactory` and the tolerant rebuild bind
now live in `transport/endpoint.rs`, with the same coalescing semantics and
tests. A client keeps a relay that failed its startup probe out for its
session; a rebuilt client endpoint goes back to the full configured set.

Custom relays (`relay_urls` / `--relay-url`) require at least two distinct
URLs; default relay mode is unchanged. Docs point at
iroh-common-architecture's relay-failover.md.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RZhxxjP2TA93PHNr6p1BU8
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RZhxxjP2TA93PHNr6p1BU8
@andrewchen5678
andrewchen5678 merged commit a6ed274 into main Sep 5, 2026
4 checks passed
@andrewchen5678
andrewchen5678 deleted the relay-failover branch September 5, 2026 16:46
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