mirror of https://github.com/k3s-io/k3s
Merge pull request #65667 from hzxuzhonghu/patch-3
Automatic merge from submit-queue (batch tested with PRs 65648, 65700, 64976, 65692, 65667). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. leader election: fix dead loop bug **What this PR does / why we need it**: bug fix: leader election calling apiserver without time interval. It is a dead loop. **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes #65666 **Special notes for your reviewer**: **Release note**: ```release-note NONE ```pull/8/head
commit
fc081b5941
|
@ -230,7 +230,7 @@ func (le *LeaderElector) renew(ctx context.Context) {
|
||||||
le.config.Lock.RecordEvent("stopped leading")
|
le.config.Lock.RecordEvent("stopped leading")
|
||||||
glog.Infof("failed to renew lease %v: %v", desc, err)
|
glog.Infof("failed to renew lease %v: %v", desc, err)
|
||||||
cancel()
|
cancel()
|
||||||
}, 0, ctx.Done())
|
}, le.config.RetryPeriod, ctx.Done())
|
||||||
}
|
}
|
||||||
|
|
||||||
// tryAcquireOrRenew tries to acquire a leader lease if it is not already acquired,
|
// tryAcquireOrRenew tries to acquire a leader lease if it is not already acquired,
|
||||||
|
|
Loading…
Reference in New Issue