-
Notifications
You must be signed in to change notification settings - Fork 111
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
Deadlock with redis #185
Comments
I found a possible solution, but it requires code change in storage/redis.lua at function storage.lock(key)
This puts the connection during spin lock wait back to the connection pool. This might introduce some overhead during waiting for a lock but it eliminates the deadlocks. |
The 4.x uses only lockless mode. With 3.x you can use |
Regenerate strategy does not really solve this. My example uses session read only which does not generate a new session. Unfortunately locking was crucial for my use case. |
I experience deadlocks when having a lot of parallel requests.
With
set $session_redis_pool_size 1
I can reproduce it always with just two requests.The code is basically:
With some debug logs I think I figured out the reason.
Is there a good way to prevent this?
I am using lua resty session 3.
With a bigger pool size there are factors which makes the deadlock more or less likely. It looks like http2 is a factor since there can be more parallel client connections.
The text was updated successfully, but these errors were encountered: