Hi @kramarz
You’re absolutely right — this is related to automatic update checks (especially for WooCommerce-paid extensions managed by Jetpack or WooCommerce.com connections).
The problem:
The error WordPress database error Deadlock found when trying to get lock; try restarting transaction happens when two database operations clash — both trying to write to wp_options (or in your case aaa_options) at the same time, causing MySQL to deadlock.
Jetpack’s Package_Version_Tracker is trying to set_transient() to cache the results of a plugin update check (e.g., to avoid hitting WooCommerce.com servers too often). It writes a transient like _transient_timeout_jetpack_update_remote_package_last_query in options table — and if your site is under heavy load (like during a shutdown hook), multiple processes might try to write/update this at the same time → deadlock.
@hemant-ahir
Cheers for confirming.
I’m rather looking for anything that I can do to prevent that error from happening though.
Or is it “safe to ignore” kind of error?
Hi @kramarz,
Welcome to the WooCommerce support forum. I completely understand wanting to find a way to prevent this from happening, rather than just accepting it.
Deadlock errors like the one you’re seeing are usually the result of high concurrency; two or more processes trying to update the same part of the database (in this case, the options table) at exactly the same time. This tends to happen during busy moments like shutdown hooks when WordPress is saving transient data related to plugin updates, including WooCommerce extensions managed via Jetpack.
At the moment, there isn’t a direct setting within WooCommerce or Jetpack to completely prevent this. However, the good news is that this specific deadlock during a transient update is generally safe to ignore; it doesn’t impact order processing, customer activity, or plugin functionality. WordPress simply retries the transient update later.
That said, if you want to reduce the chance of it happening, here are a few tips:
- Make sure your site’s database is optimized regularly.
- Use an object caching system like Redis or Memcached if your hosting supports it, which can reduce direct database writes.
- Review and minimize any unnecessary plugins that might also be writing to transients at shutdown.
If the errors are frequent and you’re seeing any performance impacts, it might be worth reaching out to your host to review database performance settings like InnoDB lock wait timeouts.
Feel free to let us know if you need any more help.
We haven’t heard back from you in a while, so I’m going to mark this as resolved.
If you have a few minutes, we’d love if you could leave us a review: https://wordpress.org/support/plugin/woocommerce/reviews/
Oh yea, sorry. Solved it by increasing some server side parameters. Cheers.
Zee (@doublezed2)
Hello Kramarz,
Thank you for your reply.
I’m glad to hear you’ve resolved the issue, and I truly appreciate you taking the time to share the solution here. Your input may help others facing the same problem.
Have a great day!