Update existing node lease with retry.

This commit is contained in:
Jianfei Bai 2019-08-20 22:10:34 +08:00
parent 1719ce7883
commit 7773662b6a

View File

@ -98,12 +98,10 @@ func (c *controller) sync() {
// If at some point other agents will also be frequently updating the Lease object, this
// can result in performance degradation, because we will end up with calling additional
// GET/PUT - at this point this whole "if" should be removed.
lease, err := c.leaseClient.Update(c.newLease(c.latestLease))
err := c.retryUpdateLease(c.newLease(c.latestLease))
if err == nil {
c.latestLease = lease
return
}
klog.Infof("failed to update lease using latest lease, fallback to ensure lease, err: %v", err)
}