deadlock
Operations wait on resources held by one another.
Use this when Concurrent transactions sometimes block until the database aborts one.
without the term
“Under load, the database sometimes kills one of our transactions with a 'deadlock detected' error. Two different endpoints update the same rows. Can you stop this from happening?”
with the term · How do you ask a model for deadlock?
Fix this deadlock by using a consistent lock order. Reproduce the competing transactions and verify bounded retries for aborted work.
What is deadlock?
A deadlock forms a cycle of waits. Consistent lock ordering and short transactions reduce opportunities for those cycles.
Why does deadlock matter when vibe coding?
Two generated handlers can acquire the same records in opposite orders.
How do you do deadlock?
Inspect the competing operations and establish an order. Check the contention case and bounded retry handling.
What goes wrong with deadlock?
Retrying forever hides the underlying cycle and increases load.
Sources for this entry
- PostgreSQL: Explicit locking
Row and table locks, blocking, deadlocks, and consistent acquisition order.
Sources checked . Source checks do not establish human editorial approval. How we check content.