Distributed deadlocks and lock convoys
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
recognize deadlocks and convoys within and across services.
Planned topics
- Database deadlock: two transactions hold locks and wait for each other; the database aborts one. Fix with consistent lock ordering and shorter transactions.
- Distributed deadlock: A waits on B while B waits on A through synchronous calls and limited pools.
- Lock convoy: many requests queue on one hot row or lock, so throughput collapses to one at a time.
- Evidence: lock wait views, deadlock logs, thread dumps showing the lock owner; hot-row metrics.
Draft outline details
Demonstration
Two orders updating the same two stock rows in opposite order; fix by sorting item IDs before locking. For a hot row, consider sharding counters or optimistic updates.
Check your understanding
What is the standard fix for a lock-order deadlock?
Show answer
Acquire locks in a consistent global order.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.