You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed a significant difference in logic between the current GitHub source code and the latest release.
Latest release
Storing the timestamp in the start variable at the start of the acquire() method.
Attempt to acquire the lock.
Calculate the expiration of the returning Lock instance based on the start variable.
This results in the Lock instance being created expired if there are enough retries, because the start is never recalculated. At the same time, the lock in Redis is perfectly fine. It leads to many problems that are not easy to trace.
Source code
Attempt to acquire the lock.
Calculate the expiration of the returning lock instance based on the start timestamp of the successful attempt.
This logic is fine, no bugs here. It was introduced in #276, but never published.
@mike-marcacci can you please release a new version with this commit?
Until then, this problem could be solved with a custom retry system that fits your scenario. For me it was:
Hello!
I noticed a significant difference in logic between the current GitHub source code and the latest release.
Latest release
start
variable at the start of theacquire()
method.Lock
instance based on thestart
variable.This results in the
Lock
instance being created expired if there are enough retries, because thestart
is never recalculated. At the same time, the lock in Redis is perfectly fine. It leads to many problems that are not easy to trace.Source code
start
timestamp of the successful attempt.This logic is fine, no bugs here. It was introduced in #276, but never published.
@mike-marcacci can you please release a new version with this commit?
Until then, this problem could be solved with a custom retry system that fits your scenario. For me it was:
The text was updated successfully, but these errors were encountered: