Release Notes for v0.82.0
Highlights
🛣️ Latency-aware HA routing that holds stable routes
Routing peers in an HA group with equal metrics are meant to be chosen by latency, but the client used to sample latency only once, when the connection was set up, and moved the route on events that did not need it. Every switch between masquerading routing peers resets the TCP connections using the route, so SSH sessions and other long-lived flows dropped more often than they had to.
The client now samples the latency of connected routing peers continuously and smooths it, and moves a route for latency only when the gain clears a margin: at least 20ms, 20% of the current latency, and the measurement noise of both paths. After a latency-driven switch it keeps the new peer for at least 30 seconds. A routing peer that drops from direct to relay keeps the route for a grace period before it moves to an equivalent direct peer, and a peer that comes up over relay first is held the same way while the others turn direct. Failover, better metrics and connected-over-idle still switch immediately.
The grace period is set on the client with NB_HA_RELAYED_SWITCH_DELAY (a duration, 0, or never; default 30s). Routing peer switches are now logged at warning level with the reason and published as system events, so they show in netbird status -d and in debug bundles.
<!-- TODO: screenshot of netbird status -d showing a routing peer switch event --> …