All Categories
  • Authentication
  • Branding
  • Changelogs
  • Collaboration
  • Compliance
  • Customization
  • External Storage
  • Frequently Asked Questions
  • Installation
  • Operations
  • Partner Products
  • Scalability
  • Security
  • Database deadlocks and lock timeouts

    Deadlocks are a classic problem in transactional databases, but they are not dangerous unless they are so frequent that you cannot run certain transactions at all. Depending on the deadlock scenario you might need to report those errors to support. This article describes how to know which deadlocks are dangerous and which could safely be ignored.

    Deadlocks vs. Lock Wait Timeouts

    When MySQL/MariaDB processes a write transaction on a table row with a lock, it either reacts with a deadlock or a lock wait depending on its lock cycle detection.

    • Deadlock: When MySQL/MariaDB detects the transaction to not be processable (e.g. due to circular dependencies amongh the acquired locks), it fails the transaction with a Deadlock.
    • Lock wait: When encountering a lock, MySQL/MariaDB waits a configured time (innodb_lock_wait_timeout in case of InnoDB locks) for the lock to be released and fails with a LockTimeoutException afterwards.

    Root cause analysis (Deadlock)