Skip to content

The connections pool growth enormously #8

@o-fedorov

Description

@o-fedorov

There are multiple issues with the connection pool:

  1. 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. Since Redis._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 error OSError: all attempts to connect to <redis host> failed
  2. 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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions