Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: give redlock enough time for locking #522

Conversation

habibalkhabbaz
Copy link
Contributor

@habibalkhabbaz habibalkhabbaz commented Oct 7, 2022

Description

redlock does not have enough time to unlock after doing the requested operation.
What I mean is that if the redlock locks a key for 500ms and it is expired before calling lock.unlock(), and then calling lock.unlock() will throw an exception like:

Unable to fully release the lock on resource "redlock:trailing-trade-configurations:global"

Because the lock already expired and unlock cannot be done on an expired lock.
Increasing the lock time to 1000ms solves the problem and it will not affect the performance or the behavior.

Suggestions from: mike-marcacci/node-redlock#65

Related Issue

Partially solve #519

Motivation and Context

How Has This Been Tested?

Tests provided

Screenshots (if appropriate):

Posted on #519

@chrisleekr chrisleekr added the bug Something isn't working label Oct 7, 2022
@chrisleekr chrisleekr linked an issue Oct 7, 2022 that may be closed by this pull request
@chrisleekr chrisleekr merged commit 2a592e1 into chrisleekr:master Oct 7, 2022
@habibalkhabbaz habibalkhabbaz deleted the fix/give-redlock-enough-locking-time branch October 10, 2022 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bot regularly hangs after sell
2 participants