Code Room
On-callMedium
Question
A service starts returning 500s with 'timeout waiting for connection from pool' to its Postgres, climbing slowly over hours after each deploy until it saturates, then a restart resets the clock. DB CPU, slow-query logs, and active-query counts are all normal — the DB is barely busy. The pool max is 20. A recent change added a code path that, on a specific validation error, returns early. Pool 'connections in use' climbs monotonically and never returns to baseline. How do you triage and fix?
What a strong answer looks like
Stop the bleeding first (mitigate), then form hypotheses from real signals. Separate root cause from symptom, communicate status as you go, and close with what prevents a repeat.
Learn the concepts
Loading whiteboard…
Run or narrate your approach, then ask the coach.