Kaynağa Gözat

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 <[email protected]>
Maisem Ali 2 yıl önce
ebeveyn
işleme
f6a203fe23
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      control/controlclient/auto.go

+ 1 - 1
control/controlclient/auto.go

@@ -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
 	}