Expand description
Deadlock and serialization failure detection utilities.
“Always be prepared to re-issue a transaction if it fails due to deadlock. Deadlocks are not dangerous. Just try again.” —
MySQL8.0 Reference Manual,InnoDBDeadlocks
InnoDB detects deadlocks instantly and rolls back one transaction (the victim).
SQLSTATE 40001 signals a serialization failure that is always safe to retry.
This module provides detection helpers for use by callers that manage their
own transaction lifecycle (e.g., the outbox sequencer, hierarchy mutations).
Functions§
- is_
deadlock - Returns
trueif the error contains SQLSTATE40001. - is_
serialization_ failure - Returns
trueif the error is a retryable serialization failure.