Skip to main content

retryable_conflict_code

Function retryable_conflict_code 

Source
pub fn retryable_conflict_code(
    err: &(dyn Error + 'static),
) -> Option<&'static str>
Expand description

The Postgres sqlstate of a failure that says nothing about the statement that hit it, or None.

Walks the whole source chain, so a sqlx::Error wrapped several layers deep in a caller’s own error type is still recognised.

  • 40P01 — deadlock detected. This transaction was chosen as the victim; another one made progress.
  • 40001 — serialization failure.

Both are properties of the contention, not of the items being probed, so a bisect re-probes the same range unsplit.