From 98e384fcd093d3cff4767ee009f8164b83bd4753 Mon Sep 17 00:00:00 2001 From: Marek Siarkowicz Date: Fri, 24 May 2024 11:07:01 +0200 Subject: [PATCH] Reset timer to zero when no progress notify was sent --- .../src/k8s.io/apiserver/pkg/storage/cacher/watch_progress.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/staging/src/k8s.io/apiserver/pkg/storage/cacher/watch_progress.go b/staging/src/k8s.io/apiserver/pkg/storage/cacher/watch_progress.go index 4c7121f14bb..087fb14e546 100644 --- a/staging/src/k8s.io/apiserver/pkg/storage/cacher/watch_progress.go +++ b/staging/src/k8s.io/apiserver/pkg/storage/cacher/watch_progress.go @@ -95,15 +95,16 @@ func (pr *conditionalProgressRequester) Run(stopCh <-chan struct{}) { select { case <-timer.C(): - timer.Reset(progressRequestPeriod) shouldRequest := func() bool { pr.mux.Lock() defer pr.mux.Unlock() return pr.waiting > 0 && !pr.stopped }() if !shouldRequest { + timer.Reset(0) continue } + timer.Reset(progressRequestPeriod) err := pr.requestWatchProgress(ctx) if err != nil { klog.V(4).InfoS("Error requesting bookmark", "err", err)