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
Kubernetes Submit Queue 2018-07-02 19:46:23 -07:00 committed by GitHub
commit fc081b5941
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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,