3079
MySQLERRORNotableLockingHIGH confidence

Lock wait was aborted

Production Risk

High — the transaction is rolled back and must be retried.

What this means

A lock request was aborted because the locking timeout was exceeded or the lock was killed externally.

Why it happens
  1. 1Lock wait timeout exceeded (innodb_lock_wait_timeout).
  2. 2The waiting transaction was killed via KILL QUERY or KILL CONNECTION.
How to reproduce
trigger — this will error
trigger — this will error
-- Session 1 holds a row lock; Session 2 waits and is killed

expected output

ERROR 3079 (HY000): Lock wait aborted.

Fix 1

Retry the transaction after a brief delay

Retry the transaction after a brief delay
-- Application-level retry logic

Why this works

Transient lock conflicts resolve once the blocking transaction commits.

Fix 2

Increase innodb_lock_wait_timeout

Increase innodb_lock_wait_timeout
SET SESSION innodb_lock_wait_timeout = 120;

Why this works

Allows more time before aborting the lock wait.

What not to do

Sources
Official documentation ↗

MySQL 8.0 — 3079 ER_LOCK_ABORTED2

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All MySQL errors