Thread Traps
Interactive Java concurrency bug drills for practicing production diagnosis.
Practice 18 Java and JVM concurrency scenarios with symptoms, runnable examples, diagnosis steps, and fixes.
Java concurrency drill map
Can you spot the broken wait?
Can you spot why tasks stop progressing?
Can you spot why throughput collapses?
Start with common production failures
- Lost Update on a Shared Counter: Lost Update on a Shared Counter: practice a Java concurrency bug with symptoms like Undercounted metric, No exception, Flaky result. Inspect runnable...
- Broken AtomicLong Watermark Update: Broken AtomicLong Watermark Update: practice a Java concurrency bug with symptoms like Watermark moves backward, Atomic field still wrong, No exception....
- Check-Then-Act Race in an Idempotency Guard: Check-Then-Act Race in an Idempotency Guard: practice a Java concurrency bug with symptoms like Duplicate side effect, Thread-safe collection still...
- Stop Flag Without volatile: Stop Flag Without volatile: practice a Java concurrency bug with symptoms like Worker never stops, Process still alive, Flaky behavior. Inspect runnable...
- Racy Lazy Initialization with Side Effects: Racy Lazy Initialization with Side Effects: practice a Java concurrency bug with symptoms like Rare inconsistent behavior, Flaky initialization,...
- Classic Java Monitor Deadlock: Classic Java Monitor Deadlock: practice a Java concurrency bug with symptoms like Requests hang, CPU not maxed, Threads blocked. Inspect runnable code,...
- ReentrantLock Without unlock() in finally: ReentrantLock Without unlock() in finally: practice a Java concurrency bug with symptoms like Threads block forever, Service appears stuck, Process alive...
- ReadWriteLock Upgrade Trap: ReadWriteLock Upgrade Trap: practice a Java concurrency bug with symptoms like Request hangs, Thread waits unexpectedly, Confusing lock behavior. Inspect...