Closed tvuotila closed 8 years ago
Interesting, this looks like a bug. How'd I miss this :confused:
About the test, it would need to have some sort of event in the middle to signal the parent that the lock was acquired.
On second thought, the test could be done in a single process I think. Just make two lock instances and don't release it from the first instance.
I changed the test to use only single process. I had to use expire to automatically release the first lock.
Alright, awesome.
PS. The failure is something unrelated, that I need to fix.
I have a system where I use python-redis-lock to synchronize my workers. I use
expire=60
together withauto_renewal=True
. If process does not release the lock within 60 seconds, waiting thread throws an error. This is not what I want. I want waiting thread to wait indefinitely until lock is released or lock expires (implying that worker, which had the lock, crashed).I could increase
expire
, but it would delay recovery from worker failure and would not be scalable.I changed code to only timeout when timeout is specified.
How to reproduce the problem:
with other window: