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

BlockingConnectionPool does not recover if redis disconnects. #3034

Open
mariusp opened this issue Nov 10, 2023 · 0 comments
Open

BlockingConnectionPool does not recover if redis disconnects. #3034

mariusp opened this issue Nov 10, 2023 · 0 comments

Comments

@mariusp
Copy link

mariusp commented Nov 10, 2023

Problem:
BlockingConnectionPool does not recover if redis disconnects.
Version: 5.0.1
How to reproduce:
Create a BlockingConnectionPool pool use it for periodic tasks, stop redis/start it back. no query to redis succeeds anymore. Sometimes it recovers but most of the times it does not.

Possible solution
Connection at this line
https://github.com/redis/redis-py/blob/d3a3ada03e080f39144807c9fbe44876c40e0548/redis/connection.py#L1102C23-L1102C23.
should not be returned in the pool, because it is broken, it should be disconnected from the pool:
await self.disconnect(connection, inuse_connections=True)

actually the self.release(connection) should be called in a sync manner, because if calls async it will endup in some kind of deadlock with another connection release

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