-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
There are multiple issues with the connection pool:
- If a
DB
instance was not deleted, its connection will never be returned to the pool. And there is no guarantee that__del__
method is to be called soon. SinceRedis._borrow_connection
does not check for the number of borrowed connections, it is possible for the code to create a lot of connections, that causes an errorOSError: all attempts to connect to <redis host> failed
- There can be multiple calls to
__del__
method during garbage collection, adding the same connection to the pool.
For me, it seems that the pool management should be revisited, also I would add an ability to explicitly borrow and return the connection.
Metadata
Metadata
Assignees
Labels
No labels