Closed gjcarneiro closed 9 years ago
Related to this, in the original "redis-exp-lock-js" project, they have this setting:
retryTimeout
The amount of time the lock function will wait before attempting to re-acquire the lock. Defaults to five milliseconds.
So, in the JS code they sleep for 0.005 seconds in case of contention, while this module sleeps for whole second!
I'd be open to a pull request that implements an exponential backoff on the retries with a max sleep period. The Kazoo code has a RetryHelper that does something similar.
Ping.
The distributed lock code handles contention by sleeping for 1 second and trying again. There is a
time.sleep(1)
call.This value seems a bit excessive in my scenario and I would rather have it as 0.1. Maybe we can make this parameter configurable?