Merge pull request #3554 from fgiudici/stable-2.3_monitor_sync

stable-2.3 | kata-monitor: increase delay before syncing with the container manager
This commit is contained in:
Peng Tao 2022-01-27 16:49:37 +08:00 committed by GitHub
commit 04426d65ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,7 +24,7 @@ const (
RuntimeContainerd = "containerd" RuntimeContainerd = "containerd"
RuntimeCRIO = "cri-o" RuntimeCRIO = "cri-o"
fsMonitorRetryDelaySeconds = 60 fsMonitorRetryDelaySeconds = 60
podCacheRefreshDelaySeconds = 5 podCacheRefreshDelaySeconds = 60
) )
// SetLogger sets the logger for katamonitor package. // SetLogger sets the logger for katamonitor package.
@ -85,7 +85,7 @@ func (km *KataMonitor) startPodCacheUpdater() {
break break
} }
// we refresh the pod cache once if we get multiple add/delete pod events in a short time (< podCacheRefreshDelaySeconds) // we refresh the pod cache once if we get multiple add/delete pod events in a short time (< podCacheRefreshDelaySeconds)
cacheUpdateTimer := time.NewTimer(podCacheRefreshDelaySeconds * time.Second) cacheUpdateTimer := time.NewTimer(5 * time.Second)
cacheUpdateTimerWasSet := false cacheUpdateTimerWasSet := false
for { for {
select { select {