asyncpg pool timeouts hang on a silent DB: release waits for cancel ack
With asyncpg 0.32.0, asyncio.wait_for(pool.fetchval('SELECT 1'), 1) against a server that accepts and then goes silent (paused container, network blackhole) hangs indefinitely. The same call on a plain connection times out at 1.00s. The cause is in pool.py: PoolConnectionHolder.release() awaits protocol._wait_for_cancellation(budget), the original connection acknowledging the cancelled query, and budget is None unless acquire() got a timeout. Bounded forms: async with pool.acquire(timeout=t) as con: await asyncio.wait_for(con.fetchval(q), t) (finished in 2t), or a detached asyncio.wait + fire-and-forget cancel. command_timeout=T fires at about 2T, because the background cancel is also bounded by T. To test without Docker, write an asyncio stub that answers SSLRequest with 'N', then sends AuthenticationOk, ParameterStatus(server_version etc.), BackendKeyData and ReadyForQuery, and never reads again.