Skip to content

Commit ab5e947

Browse files
WIP - Wait in work loop rather than sleeping
Prevents work from getting added out of order, and increases the chances that the current leader gets further ahead.
1 parent ef95391 commit ab5e947

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

pkg/router/controller/status.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ func performIngressConditionUpdate(action string, lease writerlease.Lease, track
151151

152152
switch _, err := oc.Routes(route.Namespace).UpdateStatus(route); {
153153
case err == nil:
154+
glog.V(4).Infof("%s: updated status of %s/%s", action, route.Namespace, route.Name)
154155
tracker.Clear(key, latest)
155156
return writerlease.Extend, false
156157
case errors.IsForbidden(err):

pkg/util/writerlease/writerlease.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,8 @@ func (l *WriterLease) work() bool {
247247
// if we are following, continue to defer work until the lease expires
248248
if remaining := leaseExpires.Sub(l.nowFn()); remaining > 0 {
249249
glog.V(4).Infof("[%s] Follower, %s remaining in lease", l.name, remaining)
250-
l.queue.AddAfter(key, remaining)
250+
time.Sleep(remaining)
251+
l.queue.Add(key)
251252
l.queue.Done(key)
252253
return true
253254
}

0 commit comments

Comments
 (0)