From dbc47341fabfc6dcd6b6bc0854f0a59ce4095827 Mon Sep 17 00:00:00 2001 From: Hironori Shiina Date: Wed, 8 May 2024 09:49:49 +0200 Subject: [PATCH] Update global cache timestamp more frequently There are some cases where a pod worker is woken up without a cache update by the PLEG such as a pod termination. Then, the worker gets stuck in `cache.GetNewerThan()` till the global cache timestamp is updated by the PLEG. In order to unblock the stuck worker as early as the Generic PLEG, this fix makes the Evented PLEG update the global cache as frequently as the Generic PLEG. --- pkg/kubelet/pleg/evented.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kubelet/pleg/evented.go b/pkg/kubelet/pleg/evented.go index 90e880f0dc6..eb5cc1d26c7 100644 --- a/pkg/kubelet/pleg/evented.go +++ b/pkg/kubelet/pleg/evented.go @@ -34,7 +34,7 @@ import ( // The frequency with which global timestamp of the cache is to // is to be updated periodically. If pod workers get stuck at cache.GetNewerThan // call, after this period it will be unblocked. -const globalCacheUpdatePeriod = 5 * time.Second +const globalCacheUpdatePeriod = 1 * time.Second var ( eventedPLEGUsage = false