@@ -31,6 +31,11 @@ import (
31
31
"k8s.io/utils/clock"
32
32
)
33
33
34
+ // The frequency with which global timestamp of the cache is to
35
+ // is to be updated periodically. If pod workers get stuck at cache.GetNewerThan
36
+ // call, after this period it will be unblocked.
37
+ const globalCacheUpdatePeriod = 1 * time .Second
38
+
34
39
var (
35
40
eventedPLEGUsage = false
36
41
eventedPLEGUsageMu = sync.RWMutex {}
@@ -71,10 +76,6 @@ type EventedPLEG struct {
71
76
eventedPlegMaxStreamRetries int
72
77
// Indicates relisting related parameters
73
78
relistDuration * RelistDuration
74
- // The frequency with which global timestamp of the cache is to
75
- // is to be updated periodically. If pod workers get stuck at cache.GetNewerThan
76
- // call, after this period it will be unblocked.
77
- globalCacheUpdatePeriod time.Duration
78
79
// Stop the Evented PLEG by closing the channel.
79
80
stopCh chan struct {}
80
81
// Stops the periodic update of the cache global timestamp.
@@ -86,7 +87,7 @@ type EventedPLEG struct {
86
87
// NewEventedPLEG instantiates a new EventedPLEG object and return it.
87
88
func NewEventedPLEG (runtime kubecontainer.Runtime , runtimeService internalapi.RuntimeService , eventChannel chan * PodLifecycleEvent ,
88
89
cache kubecontainer.Cache , genericPleg PodLifecycleEventGenerator , eventedPlegMaxStreamRetries int ,
89
- relistDuration * RelistDuration , clock clock.Clock , cacheUpdatePeriod time. Duration ) (PodLifecycleEventGenerator , error ) {
90
+ relistDuration * RelistDuration , clock clock.Clock ) (PodLifecycleEventGenerator , error ) {
90
91
handler , ok := genericPleg .(podLifecycleEventGeneratorHandler )
91
92
if ! ok {
92
93
return nil , fmt .Errorf ("%v doesn't implement podLifecycleEventGeneratorHandler interface" , genericPleg )
@@ -100,7 +101,6 @@ func NewEventedPLEG(runtime kubecontainer.Runtime, runtimeService internalapi.Ru
100
101
eventedPlegMaxStreamRetries : eventedPlegMaxStreamRetries ,
101
102
relistDuration : relistDuration ,
102
103
clock : clock ,
103
- globalCacheUpdatePeriod : cacheUpdatePeriod ,
104
104
}, nil
105
105
}
106
106
@@ -125,7 +125,7 @@ func (e *EventedPLEG) Start() {
125
125
e .stopCh = make (chan struct {})
126
126
e .stopCacheUpdateCh = make (chan struct {})
127
127
go wait .Until (e .watchEventsChannel , 0 , e .stopCh )
128
- go wait .Until (e .updateGlobalCache , e . globalCacheUpdatePeriod , e .stopCacheUpdateCh )
128
+ go wait .Until (e .updateGlobalCache , globalCacheUpdatePeriod , e .stopCacheUpdateCh )
129
129
}
130
130
131
131
// Stop stops the Evented PLEG
0 commit comments