diff --git a/tailnet/controllers.go b/tailnet/controllers.go index b51ddcdffe..1e5e421b97 100644 --- a/tailnet/controllers.go +++ b/tailnet/controllers.go @@ -7,6 +7,7 @@ import ( "io" "maps" "math" + "net" "net/netip" "slices" "strings" @@ -1433,6 +1434,11 @@ func (c *Controller) Run(ctx context.Context) { return } + if errors.Is(err, net.ErrClosed) { + c.logger.Warn(c.ctx, "control plane connection closed, retrying", slog.Error(err)) + continue + } + // If the database is unreachable by the control plane, there's not much we can do, so we'll just retry later. if errors.Is(err, codersdk.ErrDatabaseNotReachable) { c.logger.Warn(c.ctx, "control plane lost connection to database, retrying",