Close the done channel when there is watcher error
@@ -581,6 +581,7 @@ func (s *Server) StartExitMonitor() {
}
case err := <-watcher.Errors:
logrus.Debugf("watch error: %v", err)
+ close(done)
return
case <-s.monitorsChan:
logrus.Debug("closing exit monitor...")
