markokr/pgbouncer-dev — pull request #16 by ccutrer (2013-09-27 19:44:10+00:00)
Title: fix launching new connections during maintenance

match up waiting connections with tested/used until we run out.
launches new connection if there are more waiting than could be
fulfilled by refreshing current connections. this situation can
happen if you have high churn on client connections (i.e. with
transaction pooling), such that there is *always* at least one
connection in sv_tested or sv_used.

this condition is exacerbated if latency goes up to the database
from the bouncer, causing connections to take longer to return
from sv_tested. latency can go up even in LAN configurations
if load on the db becomes so high that network packet
processing starts to be delayed