control/controlclient: check c.closed in waitUnpause

We would only check if the client was paused, but not
if the client was closed. This meant that a call to
Shutdown may block forever/leak goroutines

Updates #cleanup

Signed-off-by: Maisem Ali <maisem@tailscale.com>
pull/9268/head
Maisem Ali 8 months ago committed by Maisem Ali
parent 45eeef244e
commit f6a203fe23

@ -38,7 +38,7 @@ var _ Client = (*Auto)(nil)
// closed).
func (c *Auto) waitUnpause(routineLogName string) (keepRunning bool) {
c.mu.Lock()
if !c.paused {
if !c.paused || c.closed {
defer c.mu.Unlock()
return !c.closed
}

Loading…
Cancel
Save