From bd157bf69b115c1b57144fa1e915717eb9c41170 Mon Sep 17 00:00:00 2001 From: IvanHunters Date: Wed, 11 Nov 2026 16:38:27 +0300 Subject: [PATCH] fix(mesh): raise the check-in period to 5m on large clusters A node's WireGuard IP is assigned by its rank in the currently Ready set, and a node counts as Ready only while its last-seen annotation is within twice the check-in period (60s with the 30s default). On large clusters the per-node last-seen writes generate enough watch churn that liveness cannot propagate within that window, so every agent's Ready set collapses and most nodes collide on the first address of the subnet, breaking the mesh. Raise the check-in period to 5m (a 10m Ready window) so the Ready set stays close to the full node set. This is a mitigation, not a root-cause fix: the underlying problem is that IP allocation is coupled to the volatile Ready set. Signed-off-by: IvanHunters --- pkg/mesh/backend.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pkg/mesh/backend.go b/pkg/mesh/backend.go index 78becc89..9b59b247 100644 --- a/pkg/mesh/backend.go +++ b/pkg/mesh/backend.go @@ -25,8 +25,17 @@ import ( ) const ( - // checkInPeriod is how often nodes should check-in. - checkInPeriod = 30 * time.Second + // checkInPeriod is how often nodes should check in. It is deliberately + // raised above the upstream default of 30s. A node's WireGuard IP is + // assigned by its rank in the currently Ready set, and a node is Ready + // only while its last-seen is within twice this value. On large clusters + // the per-node last-seen writes create enough watch churn that liveness + // cannot propagate within a 60s window, collapsing every agent's Ready set + // and colliding most nodes on the first address of the subnet. A longer + // period widens the freshness window so the Ready set stays close to the + // full node set. This is a mitigation, not a root-cause fix; see + // https://github.com/squat/kilo/issues/549. + checkInPeriod = 5 * time.Minute // DefaultKiloInterface is the default interface created and used by Kilo. DefaultKiloInterface = "kilo0" // DefaultKiloPort is the default UDP port Kilo uses.