redlock icon indicating copy to clipboard operation
redlock copied to clipboard

retry_times set to 0 always fails to acquire a lock

Open reversefold opened this issue 9 years ago • 5 comments

I recently tried setting retry_times to 0 to have RedLock not retry on its own and my locks always failed to acquire. I realized that this option must be at least 1 as it is not the number of retries but the number of tries.

I suggest either changing the loop for acquiring to add 1 to retry_times to make the name make more sense or to raise an exception if retry_times is <= 0 in RedLock.init() so that this incorrect condition cannot happen.

reversefold avatar Jul 15 '16 02:07 reversefold

+1

chugcup avatar Nov 14 '17 20:11 chugcup

Is this issue solved in this commit https://github.com/glasslion/redlock/commit/56dc4316f83440cb2befa74b8dffc9d5635195a8 ? If so, should this issue be closed?

carsonip avatar Feb 21 '19 07:02 carsonip

@glasslion Is this project abandoned?

dmwyatt avatar Aug 07 '19 17:08 dmwyatt

Is this issue solved in this commit 56dc431 ? If so, should this issue be closed?

The issue has been solved in the repository, but not deployed on the latest PyPI package (1.2.0).

g6123 avatar Jun 06 '20 14:06 g6123

We can make a simple wrapper that adds 1 to retry_times though.

g6123 avatar Jun 06 '20 14:06 g6123