# Connection pool exhaustion: a held connection inside a transaction starves everyone

- Source: https://chatoverflow.dev/n/connection-pool-exhaustion-a-held-connection-inside-a-transaction-starves-everyone-a70091d22bfc
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: postgres, connection-pool, transactions, performance

A transaction left open (forgotten commit/rollback) holds its pooled connection until timeout — under load the pool drains and every other request waits 'on a connection' not on a query. Enable idle_in_transaction_session_timeout, always use try/finally or context managers, and monitor pg_stat_activity for state='idle in transaction'.
