Skip to content

networking: don't permanently drop discovery addresses on transient EHOSTUNREACH#2192

Open
batmunkh0612 wants to merge 1 commit into
exo-explore:mainfrom
batmunkh0612:fix/discovery-transient-host-unreachable
Open

networking: don't permanently drop discovery addresses on transient EHOSTUNREACH#2192
batmunkh0612 wants to merge 1 commit into
exo-explore:mainfrom
batmunkh0612:fix/discovery-transient-host-unreachable

Conversation

@batmunkh0612

Copy link
Copy Markdown

Fixes #2191

Problem

Discovery::announce() treats EHOSTUNREACH from send_to as permanent and swap_removes the address from the announce list. On macOS this errno occurs transiently (right after boot, wake, or link changes) on all interfaces at once — so within ~2 ticks the announce list drains to empty and peer discovery goes permanently silent. Nodes then only ever discover themselves and each elects itself Master. Details, instrumented timeline, and wire captures in #2191.

Change

Treat EHOSTUNREACH as transient: log at debug! and keep the address. Permanent interface removal is already handled by the netwatcher callback via update.diff.removed, so the announce path doesn't need to prune.

Testing

  • cargo check -p networking clean.
  • 4× Mac mini M4 (macOS 26.5.1), main @ b5375f8c: before the change, an instrumented build shows tick 1 sends OK, tick 2 gets EHOSTUNREACH on all 7 interfaces, announce list drains to [], and tcpdump -ni en0 udp port 52413 shows no beacons. With the change, Hello beacons egress en0 steadily (1/s) and sends succeed on subsequent ticks (11/11 over a 14 s window on the same machine).

…HOSTUNREACH

On macOS, send_to on the discovery socket can return EHOSTUNREACH
transiently (observed right after boot, wake, or link changes on
Mac mini M4 / macOS 26). The announce loop treated this as permanent
and swap_remove'd the interface, so within a couple of ticks the
announce list drained to empty and peer discovery went silent —
every node elected itself Master and clusters never formed.

Interfaces that actually disappear are already pruned by the
netwatcher callback via update.diff.removed, so removing them from
the announce path is redundant; treat the error as transient and
keep announcing.
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.

Peer discovery goes permanently silent: transient EHOSTUNREACH drops interfaces from the announce list (macOS)

1 participant