MotorPool.get_socket() proactively checks a socket for errors if it hasn't been used in more than a second. It calls select() on the socket's file descriptor to see if socket has been shutdown at the OS level.
If this check fails, MotorPool fails to decrement its socket counter, so the closed socket is forever counted against max_pool_size.
This is the equivalent of a semaphore leak in a normal multi-threaded connection pool.