mirror of
https://github.com/netbirdio/netbird.git
synced 2026-05-30 12:39:54 +00:00
The backoff loop only retried on codes.Canceled, but mgmCtx was derived from context.Background() and never cancelled by anything — so every real error path (Unavailable, DeadlineExceeded, etc.) went through backoff.Permanent on the first attempt. The loop was a no-op wrapper that just held the call open for the daemon's lifetime regardless of shutdown. Replace with a single context.WithTimeout(c.ctx, ConnectTimeout) call. Daemon shutdown now interrupts the RPC; behaviour on real errors is unchanged.