portworx / kvdb

Generic Key-Value interface
Apache License 2.0
40 stars 12 forks source link

retry the lock operation only when someone else is holding the lock #102

Open pureneelesh opened 3 years ago

pureneelesh commented 3 years ago

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: