Skip to content

Harden event/connection handling after zenoh merge - #2232

Open
caesarniseko-coder wants to merge 1 commit into
exo-explore:mainfrom
caesarniseko-coder:fix/post-zenoh-merge-wip
Open

Harden event/connection handling after zenoh merge#2232
caesarniseko-coder wants to merge 1 commit into
exo-explore:mainfrom
caesarniseko-coder:fix/post-zenoh-merge-wip

Conversation

@caesarniseko-coder

@caesarniseko-coder caesarniseko-coder commented Jul 22, 2026

Copy link
Copy Markdown

Summary

Reliability hardening reconciled on top of the libp2p→zenoh migration. Two changes are new; two overlap fixes already merged and are included defensively (happy to drop them if redundant).

New:

  • election: add a configurable connection-election cooldown (default 25s). After a connection-triggered campaign, _connection_receiver waits then drains connection events that arrived during topology formation, so each distinct topology change triggers exactly one re-election instead of perpetual re-elections from zenoh gossip/reconnect bursts. Injectable via the constructor (connection_election_cooldown) so tests can set it to 0.
  • apply: recompute thunderbolt_bridge_cycles when network interfaces or out-RDMA connections change (previously only updated on ThunderboltBridgeInfo).

Defensive / possibly-redundant with existing fixes:

Testing

  • Full unit suite: uv run pytest src -m "not slow" --import-mode=importlib469 passed, 3 skipped
  • ruff check, ruff format --check, basedpyright → clean on changed files
  • End-to-end smoke test on uv run exo (Apple Silicon, MLX + zenoh): server boots, node elects master + starts Worker/DownloadCoordinator/API, dashboard renders, GET /v1/models and GET /state return 200, hardware telemetry (macmon) live.

🤖 Generated with Claude Code

Reconcile local reliability fixes on top of the libp2p→zenoh update:

- election: add configurable connection-election cooldown (default 25s) that
  drains topology-formation bursts so each distinct topology change triggers
  exactly one re-election; injectable via constructor for fast tests.
- apply: skip out-of-order indexed events instead of asserting (defensive
  against event-idx gaps), and recompute thunderbolt_bridge_cycles when
  network interfaces or out-RDMA connections change.
- download/coordinator, worker: guard event sends against
  Broken/ClosedResourceError on stream teardown.
- test_election: run the connection-round test with a 0s cooldown.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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