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

Redis lock with setnx will lead to deadlocks #46

Open
twisted1919 opened this issue Dec 20, 2021 · 0 comments
Open

Redis lock with setnx will lead to deadlocks #46

twisted1919 opened this issue Dec 20, 2021 · 0 comments

Comments

@twisted1919
Copy link

Hello,

We used to use the library in one of our applications and we always got deadlocks when under certain load.
Because of the nature of such problems, it was extraordinary difficult to find why this happens, we have changed our code multiple times and never suspected the problem is caused by an underlaying library.

In one of the debug sessions, using strace we could see the process is stuck doing a SETNX command. Reading about the command at https://redis.io/commands/setnx#design-pattern-locking-with-codesetnxcode says it should not be used for this purposes anymore. Digging further to see what piece of code uses this command, we ended up finding https://github.com/arvenil/mutex/blob/master/src/Lock/PredisRedisLock.php#L45

Maybe you should look into it and find a better alternative.
Best.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant