From 4b775046d4f02c2c1c222bc446e5afe52d76771c Mon Sep 17 00:00:00 2001 From: xieyanker Date: Thu, 29 Aug 2019 11:06:45 +0800 Subject: [PATCH] remove stateCheckPeriod If exec logForceCheckPeriod, there is no need to exec stateCheckPeriod --- pkg/kubelet/kuberuntime/logs/logs.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/pkg/kubelet/kuberuntime/logs/logs.go b/pkg/kubelet/kuberuntime/logs/logs.go index 93b0cd39392..58554fa200e 100644 --- a/pkg/kubelet/kuberuntime/logs/logs.go +++ b/pkg/kubelet/kuberuntime/logs/logs.go @@ -51,11 +51,6 @@ const ( // timeFormat is the time format used in the log. timeFormat = time.RFC3339Nano - // stateCheckPeriod is the period to check container state while following - // the container log. Kubelet should not keep following the log when the - // container is not running. - stateCheckPeriod = 5 * time.Second - // logForceCheckPeriod is the period to check for a new read logForceCheckPeriod = 1 * time.Second ) @@ -447,10 +442,6 @@ func waitLogs(ctx context.Context, id string, w *fsnotify.Watcher, runtimeServic errRetry-- case <-time.After(logForceCheckPeriod): return true, false, nil - case <-time.After(stateCheckPeriod): - if running, err := isContainerRunning(id, runtimeService); !running { - return false, false, err - } } } }