Skip to content

Commit 05605d7

Browse files
committed
Revert "Address feedback"
This reverts commit 7aa7062.
1 parent 7aa7062 commit 05605d7

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

pkg/kubelet/kubelet.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,6 @@ const (
184184
eventedPlegRelistPeriod = time.Second * 300
185185
eventedPlegRelistThreshold = time.Minute * 10
186186
eventedPlegMaxStreamRetries = 5
187-
// Evented PLEG needs to update the global timestamp of the cache as frequently as Generic PLEG relisting
188-
// in order to wake up pod workers that get stuck in cache.GetNewerThan().
189-
eventedPlegCacheUpdatePeriod = genericPlegRelistPeriod
190187

191188
// backOffPeriod is the period to back off when pod syncing results in an
192189
// error. It is also used as the base period for the exponential backoff
@@ -739,7 +736,7 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
739736
RelistThreshold: genericPlegRelistThreshold,
740737
}
741738
klet.eventedPleg, err = pleg.NewEventedPLEG(klet.containerRuntime, klet.runtimeService, eventChannel,
742-
klet.podCache, klet.pleg, eventedPlegMaxStreamRetries, eventedRelistDuration, clock.RealClock{}, eventedPlegCacheUpdatePeriod)
739+
klet.podCache, klet.pleg, eventedPlegMaxStreamRetries, eventedRelistDuration, clock.RealClock{})
743740
if err != nil {
744741
return nil, err
745742
}

pkg/kubelet/pleg/evented.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ import (
3131
"k8s.io/utils/clock"
3232
)
3333

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+
3439
var (
3540
eventedPLEGUsage = false
3641
eventedPLEGUsageMu = sync.RWMutex{}
@@ -71,10 +76,6 @@ type EventedPLEG struct {
7176
eventedPlegMaxStreamRetries int
7277
// Indicates relisting related parameters
7378
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
7879
// Stop the Evented PLEG by closing the channel.
7980
stopCh chan struct{}
8081
// Stops the periodic update of the cache global timestamp.
@@ -86,7 +87,7 @@ type EventedPLEG struct {
8687
// NewEventedPLEG instantiates a new EventedPLEG object and return it.
8788
func NewEventedPLEG(runtime kubecontainer.Runtime, runtimeService internalapi.RuntimeService, eventChannel chan *PodLifecycleEvent,
8889
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) {
9091
handler, ok := genericPleg.(podLifecycleEventGeneratorHandler)
9192
if !ok {
9293
return nil, fmt.Errorf("%v doesn't implement podLifecycleEventGeneratorHandler interface", genericPleg)
@@ -100,7 +101,6 @@ func NewEventedPLEG(runtime kubecontainer.Runtime, runtimeService internalapi.Ru
100101
eventedPlegMaxStreamRetries: eventedPlegMaxStreamRetries,
101102
relistDuration: relistDuration,
102103
clock: clock,
103-
globalCacheUpdatePeriod: cacheUpdatePeriod,
104104
}, nil
105105
}
106106

@@ -125,7 +125,7 @@ func (e *EventedPLEG) Start() {
125125
e.stopCh = make(chan struct{})
126126
e.stopCacheUpdateCh = make(chan struct{})
127127
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)
129129
}
130130

131131
// Stop stops the Evented PLEG

0 commit comments

Comments
 (0)