Skip to content

Commit 4d313ac

Browse files
committed
Lower max retry delay
Signed-off-by: Jun Duan <jun.duan.phd@outlook.com>
1 parent f1ef943 commit 4d313ac

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pkg/controller/generic/queue-work.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ import (
2626
"k8s.io/klog/v2"
2727
)
2828

29+
const (
30+
controllerQueuePerItemRetryMaxDelay = 20 * time.Second
31+
)
32+
2933
// QueueAndWorkers is generic code for a typical controller's workqueue and worker goroutines
3034
// that pull from that queue.
3135
type QueueAndWorkers[Item comparable] struct {
@@ -62,7 +66,10 @@ func newQueueAndWorkers[Item comparable](
6266
ans := QueueAndWorkers[Item]{
6367
ControllerName: controllerName,
6468
Queue: workqueue.NewTypedRateLimitingQueueWithConfig(
65-
workqueue.DefaultTypedControllerRateLimiter[Item](),
69+
workqueue.NewTypedWithMaxWaitRateLimiter(
70+
workqueue.DefaultTypedControllerRateLimiter[Item](),
71+
controllerQueuePerItemRetryMaxDelay,
72+
),
6673
workqueue.TypedRateLimitingQueueConfig[Item]{
6774
Name: controllerName,
6875
}),

0 commit comments

Comments
 (0)