bug fix: dead loop leaderelection

Kubernetes-commit: 7a2c5794097dba18a3bf9e170e8c0b2ff4a916d7
This commit is contained in:
xuzhonghu 2018-07-02 15:49:39 +08:00 committed by Kubernetes Publisher
parent 4b3edba2be
commit 1ca2f836dc

View File

@ -230,7 +230,7 @@ func (le *LeaderElector) renew(ctx context.Context) {
le.config.Lock.RecordEvent("stopped leading")
glog.Infof("failed to renew lease %v: %v", desc, err)
cancel()
}, 0, ctx.Done())
}, le.config.RetryPeriod, ctx.Done())
}
// tryAcquireOrRenew tries to acquire a leader lease if it is not already acquired,