Skip to content

fix(airc): stop dialing ghost peers — prune stale enrolled records (#10) - #1272

Merged
joelteply merged 1 commit into
canaryfrom
fix/airc-prune-ghost-dials
Jun 20, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/airc-prune-ghost-dials

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

The noise we hit debugging cross-machine LAN

Route discovery dialed every enrolled peer with a stored endpoint every tick — including ~30 dead Docker containers (172.x) and abandoned self-scopes whose endpoints linger in the trust store forever. Each burned a 3s PEER_DIAL_TIMEOUT and buried the live peers under a wall of PeerDialFailed warnings — that's a big part of what made the real connection state illegible.

Fix

Skip ghosts in the dial merge: enrolled peers with no fresh contact (last_seen_ms older than the registry freshness TTL — the one source of truth).

  • A live peer's registry beacon refreshes last_seen every cycle → never skips a reachable peer.
  • A connected peer is already skipped; a freshly-enrolled peer has last_seen floored to added_at → fresh adds dial normally.
  • The count is surfaced on RouteDiscoverySnapshot.ghost_peers_skipped (queryable, not a per-ghost log line — anti-spam, the whole point is reducing noise).

Test

is_ghost_peer respects the TTL boundary (strictly-greater) and a future/skewed last_seen reads fresh (saturating, no underflow).

Completes the recover/heal/route-around series alongside #8 (stable port, merged) and #1257 (self-heal, merged). #9 (learn-live-address) deferred — #8 + this already resolve the core auto-connect case; #9 becomes a robustness layer for genuinely-moved peers.

🤖 Generated with Claude Code

joelteply added a commit that referenced this pull request Jun 20, 2026
…ho) + fmt (#1274)

fix(build): repair canary — #1271 added EventFilter.self_echo but missed examples + fmt

#1271 (suppress own broadcasts from the join feed) added a required field
`self_echo: Option<SelfEcho>` to EventFilter, but only updated the airc-cli
construction sites — the example crates (consumer_shapes, embedded_consumer_smoke)
still construct EventFilter without it, so the whole workspace failed to compile
(E0063), reddening clippy + `cargo test --workspace` on every platform. It also
left stream.rs fmt-dirty. Canary merged red, so EVERY downstream PR inherited a
broken gate (hit live on #1272).

Fix: add `self_echo: None` to every example EventFilter (None = no self-echo
suppression — consumers/RAG/Continuum must keep seeing everything, per the
design note in stream.rs) and run rustfmt. Verified: `cargo build --workspace`
clean, `cargo fmt --check` clean, production no-silent-fallback gate green.

(Process note: this is the 2nd red-canary inheritance this cycle after #1264 —
canary protection isn't enforcing green CI before merge.)

Co-authored-by: Claude Opus 4.8 <[email protected]>
Route discovery dialed EVERY enrolled peer with a stored endpoint every tick,
including ~30 dead Docker containers (172.x) and abandoned self-scopes whose
endpoints linger in the trust store forever. Each burned a PEER_DIAL_TIMEOUT
(3s) and buried the live peers under a wall of PeerDialFailed noise — it's what
made the real connection state illegible while debugging cross-machine LAN.

Fix: skip GHOSTS in the dial merge — enrolled peers with no fresh contact
(last_seen_ms older than the registry freshness TTL, the one source of truth).
A live peer's registry beacon refreshes last_seen every cycle, so this never
skips a reachable peer; a connected peer is already skipped; a freshly-enrolled
peer has last_seen floored to added_at, so fresh adds dial normally. The count
is surfaced on RouteDiscoverySnapshot.ghost_peers_skipped (queryable, not a
per-ghost log line — anti-spam).

Test: is_ghost_peer respects the TTL boundary (strictly-greater) and a
future/skewed last_seen reads fresh (saturating, no underflow).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@joelteply
joelteply force-pushed the fix/airc-prune-ghost-dials branch from 3899229 to 6a41066 Compare June 20, 2026 23:14
@joelteply
joelteply merged commit f9266f3 into canary Jun 20, 2026
11 of 12 checks passed
@joelteply
joelteply deleted the fix/airc-prune-ghost-dials branch June 20, 2026 23:23
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