We were retrying the lock operation for 5 minutes on all the errors. Create()
ends up calling LeaseWithRetries() which has 30 retries with 2 sec sleep.
If kvdb is down, the 5 min wait was causing unnecessary delay. Now, we use
the 5 minutes timeout only when someone is holding the lock.
What this PR does / why we need it:
We were retrying the lock operation for 5 minutes on all the errors. Create() ends up calling LeaseWithRetries() which has 30 retries with 2 sec sleep. If kvdb is down, the 5 min wait was causing unnecessary delay. Now, we use the 5 minutes timeout only when someone is holding the lock.
Which issue(s) this PR fixes (optional) Closes #
Special notes for your reviewer: