Phase 9 R1: repo-ensure RPC + fleet-health fixes #107
@@ -91,9 +91,30 @@ impl V2State {
|
||||
.join("aggregator-sessions.json");
|
||||
let sessions = SessionStore::load(sessions_path)
|
||||
.map_err(|e| anyhow::anyhow!("loading session store: {e}"))?;
|
||||
// Bug fix 2026-07-31: the fleet view previously never included
|
||||
// the node actually serving the dashboard — `cluster.peers` is
|
||||
// by definition every *other* node, so hitting a given node's
|
||||
// `/api/v2/fleet` directly silently dropped that node from its
|
||||
// own view (looked like "node X is missing" from the UI, even
|
||||
// though X was perfectly healthy — it just never queried
|
||||
// itself). Fix: synthesize a self `PeerEntry` from our own
|
||||
// gossip bind address and include it in the fan-out list, same
|
||||
// as any other peer. `peer_rpc_addr` derives the RPC port from
|
||||
// `lan_addr`/`tailscale_addr` via the fleet's +1 convention, so
|
||||
// this resolves to the same `bind_rpc_lan`/`bind_rpc_tailscale`
|
||||
// the daemon actually listens on.
|
||||
let self_peer = PeerEntry {
|
||||
name: cfg.node.name.clone(),
|
||||
zone: cluster.zone.clone(),
|
||||
lan_addr: cluster.bind_lan,
|
||||
tailscale_addr: cluster.bind_tailscale,
|
||||
};
|
||||
let mut peers = cluster.peers.clone();
|
||||
peers.push(self_peer);
|
||||
|
||||
Ok(Self {
|
||||
aggregator_name: cfg.node.name.clone(),
|
||||
peers: cluster.peers.clone(),
|
||||
peers,
|
||||
client: std::sync::Arc::new(client),
|
||||
default_rpc_port_offset: 1,
|
||||
api_token: cfg.api_token.clone(),
|
||||
|
||||
Reference in New Issue
Block a user