Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Stop leaking connections when pool is full #473

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jul 19, 2021

  1. Stop leaking connections when pool is full

    When our connection pool is full (there are no available connections) we
    can run into a case where we leak perfectly useable connections. This
    essentially reduces the size of our connection pool every time it
    happens, as it can slowly leak away our unused connections until we
    don't have enough connections available to cope with our workload.
    
    This is particularly problematic when preparing connections for a
    pipeline, since we can potentially request (and leak) a large number of
    connections in one go.
    
    This change makes sure that before raising an exception if there are no
    available connections we return back all connections we've checked to
    the pool. In cases where we can't guarantee the connections we'd return
    to the pool are in a safe state we just add back `None` objects to the
    pool so at least the effective size of the connection pool remains
    unchanged.
    Fran Garcia committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    73e949a View commit details
    Browse the repository at this point in the history