Fixed
Project:
Advanced Queue
Version:
8.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Aug 2026 at 12:21 UTC
Updated:
7 Sep 2026 at 16:29 UTC
Jump to comment: Most recent
On a production site if I have two runners both processing the same queues I hit deadlocks.
Executing: /var/www/html/vendor/bin/drush advancedqueue:queue:process entity_usage_custom_views --timeout=20 --uri=REDACTED [1088.15 sec, 14.75 MB]
>
> In ExceptionHandler.php line 96:
>
> SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to
> get lock; try restarting transaction: UPDATE "advancedqueue" SET "payload"=
> :db_update_placeholder_0, "state"=:db_update_placeholder_1, "message"=:db_u
> pdate_placeholder_2, "num_retries"=:db_update_placeholder_3, "available"=:d
> b_update_placeholder_4, "processed"=:db_update_placeholder_5, "expires"=:db
> _update_placeholder_6
> WHERE "job_id" = :db_condition_placeholder_0; Array
> (
> [:db_update_placeholder_0] => {"entity_type":"media","entity_id":2468}
> [:db_update_placeholder_1] => success
> [:db_update_placeholder_2] =>
> [:db_update_placeholder_3] => 0
> [:db_update_placeholder_4] => 1787741344
> [:db_update_placeholder_5] => 1787741580
> [:db_update_placeholder_6] => 0
> [:db_condition_placeholder_0] => 237422
> )
>
>
> In PdoTrait.php line 109:
>
> SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to
> get lock; try restarting transaction
This occurs because we call cleanupQueue a lot and this updates lots of rows using the secondary index and claim and update use the primary index to grab a single row.
The fix is to:
Implement and test.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
alexpottComment #4
alexpottComment #5
alexpottI've tested this on a production release that was getting deadlocks and now it's not deadlocking so that's great.
Comment #7
alexpott