e665f74c99
Previously it was checking TotalConns but that includes ConstructingConns. Instead it should directly check IdleConns so the next Acquire takes one of those and doesn't make a 3rd connection. The check against the context was also wrong which prevented this from timing out after 2 minutes. This also fixes a bug where NewConnsCount was not correctly counting connections created by Acquire directly. Fixes #1690