Problem/Motivation

Calling Queue::addOperationToQueue() too often causes

Duplicate entry 'batch_plugin_queue_worker:<ID>'

Suggested fix: Fix the queue context write to be upsert-style instead of delete-then-insert.

The current queue context logic is vulnerable because it does:

delete row for queue_id
insert row for queue_id

That is not safe when multiple requests run at the same time.

Change it to a merge() so Drupal performs an insert-or-update operation.

CommentFileSizeAuthor
#2 batch_plugin-3592334-01.patch1.29 KBdahousecat

Comments

dahousecat created an issue. See original summary.

dahousecat’s picture

StatusFileSize
new1.29 KB
dubs’s picture

Status: Active » Fixed

Thank you - that's merged now.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

dubs’s picture

Status: Fixed » Closed (fixed)