diff --git a/watchtower/wtclient/client.go b/watchtower/wtclient/client.go index 7845d81e6..7b1653b9e 100644 --- a/watchtower/wtclient/client.go +++ b/watchtower/wtclient/client.go @@ -566,6 +566,7 @@ func (c *TowerClient) backupDispatcher() { // Wait until we receive the newly negotiated session. // All backups sent in the meantime are queued in the // revoke queue, as we cannot process them. + awaitSession: select { case session := <-c.negotiator.NewSessions(): log.Infof("Acquired new session with id=%s", @@ -576,6 +577,12 @@ func (c *TowerClient) backupDispatcher() { case <-c.statTicker.C: log.Infof("Client stats: %s", c.stats) + // Instead of looping, we'll jump back into the + // select case and await the delivery of the + // session to prevent us from re-requesting + // additional sessions. + goto awaitSession + case <-c.forceQuit: return }