-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Deadlock in PubSub
class after update to 5.3.0
#3640
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
Comments
+1 |
Hi @ManelCoutinhoSensei, thanks for reporting this! We will have a look at it shortly. |
+1 |
I ran into the same issue using django-celery-beat. Below are the logs. Had to downgrade Redis to version 5.2.1 to resolve it.
|
@Darek07 did you try just released 6.2.0 ? It says in release notes that it fixes one deadlock. |
@matejsp I don't know which is the lock that causes the issue on |
Unfortunately it doesn't help. With redis 6.2.0 the problem still appears. |
Hi again!
I just updated redis-py from 5.2.1 to 5.3.0 and I noticed that while adding the
Dispatchers
there was deadlock introduced.Summary
When using a client with
Retries
enabled and subscribing to a pattern usingpsubscribe
, a deadlock can occur under certain conditions:punsubscribe
is attempted and a disconnection (such as a broken pipe) happens during this process, a reconnection is triggered (via thePubSub._execute
error handling).Full explanation
There was a new lock introduced before each
PubSub
command execution on commit40e5fc1
, which is part of the 5.3.0 release:redis-py/redis/client.py
Lines 874 to 875 in 7130e1a
When a command execution fails, if
Retries
are enabled, there will be a reconnection attempt:redis-py/redis/client.py
Lines 895 to 916 in 7130e1a
However, when executing the
connect
we get to the final lines where the resubscriptions callbacks are triggered forpubsub
:redis-py/redis/connection.py
Lines 406 to 413 in 7130e1a
This will hit the same lock again a cause a deadlock.
Let me know if you need any other information. 🙂
The text was updated successfully, but these errors were encountered: