Diagnosishard5-8 years
Production requests are hanging. How do you tell a deadlock from thread-pool exhaustion?
Take three thread dumps ten seconds apart. A deadlock is printed explicitly by the JVM — two threads each holding a lock the other wants — and the fix is lock ordering or tryLock. Pool exhaustion shows every worker thread in the same frame waiting on one resource (a connection pool, an HTTP call); the fix starts with timeouts and a bulkhead, then the root cause.