Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Retry new connection on checkout after reap
When we reap connections, we check if they are inactive (connected and responding to ping in most adapters) and if so we remove the connection instead of checking it back in. However, in acquire_connection, we weren't checking after reaping whether we were allowed to build a new connection, only whether an existing one was in the available pool. This still leaves a race condition where if the background reaper thread runs while a thread is polling and finds a free inactive connection, it could have the same issue and not wake the waiting thread. However we don't really expect the reaper to solve this (it only runs every 60 seconds by default, far too slow to solve for a blocked thread). I think this should be fixed, just separately.
- Loading branch information