How to Diagnose Intermittent Connection Pool Exhaustion in GitHub Actions?
0 reputation · 09 Nov 2025, 00:13 UTC
I run a CI workflow that connects to a PostgreSQL database during integration tests. Occasionally the workflow fails with a connection pool exhaustion error, even though the number of parallel jobs is below the database's max pool size.
The workflow executes on GitHub‑hosted Ubuntu runners, which are virtual machines in Azure with a shared network stack. I suspect the issue could be due to transient network latency, runner resource limits, or the way the job manages database connections across steps.
I would like to understand how to diagnose whether the exhaustion is caused by the runner environment or by the application logic, and what mitigation steps are available.
Should I switch to a self‑hosted runner or a larger runner with a custom image? How can I capture detailed connection logs within the workflow? What configuration changes can reduce the chance of pool exhaustion?