瀏覽代碼

Merge pull request #40096 from cpuguy83/c8d_no_healthcheck_loop

Wait for c8d process exit instead of polling API
Brian Goff 5 年之前
父節點
當前提交
1e000435e6
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      libcontainerd/supervisor/remote_daemon.go

+ 9 - 0
libcontainerd/supervisor/remote_daemon.go

@@ -300,6 +300,7 @@ func (r *remote) monitorDaemon(ctx context.Context) {
 				delay = 100 * time.Millisecond
 				continue
 			}
+			logrus.WithField("address", r.GRPC.Address).Debug("Created containerd monitoring client")
 		}
 
 		if client != nil {
@@ -313,6 +314,14 @@ func (r *remote) monitorDaemon(ctx context.Context) {
 				}
 
 				transientFailureCount = 0
+
+				select {
+				case <-r.daemonWaitCh:
+				case <-ctx.Done():
+				}
+
+				// Set a small delay in case there is a recurring failure (or bug in this code)
+				// to ensure we don't end up in a super tight loop.
 				delay = 500 * time.Millisecond
 				continue
 			}