Thread pool exhaustion occurs when every worker thread is occupied and incoming tasks cannot execute. Tasks may block, queue, or drop, causing latency, timeouts, and wider cascading failures. section 12.3.1
Investigate the condition by connecting symptoms to blocked downstream work:
- Inspect thread dumps for many WAITING or TIMED_WAITING threads sharing a remote-call stack trace. section 12.3.1
- Look for blocked HTTP clients, socket reads, connection pools, or calls such as RestTemplate.exchange() and HttpClient.send(). section 12.3.1
- Use trace IDs and spans to compare client and downstream-service durations and locate the slow operation. section 12.4
Blocked payment requests
A thread dump shows servlet workers parked in CompletableFuture.get() while RestTemplate.exchange() waits for a payment gateway. Repeated traces indicate that a slow downstream call is occupying upstream threads.
