Skip to content

BlockingConnectionPool does not recover if redis disconnects. #3034

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

Closed
mariusp opened this issue Nov 10, 2023 · 1 comment
Closed

BlockingConnectionPool does not recover if redis disconnects. #3034

mariusp opened this issue Nov 10, 2023 · 1 comment
Labels

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

Copy link
Contributor

This issue is marked stale. It will be closed in 30 days if it is not updated.

@github-actions github-actions bot added the Stale label Apr 22, 2025
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant