- πΊπΈUnited States douggreen Winchester, VA
I came to the similar solution on my own, but I think you want to update the expire time before you grab the data.
- πΊπΈUnited States douggreen Winchester, VA
And modern Drupal has the same problem, see DatabaseQueue.
My summary of what is happening. Let's say that you have 10,000 items in your queue, and the serialized data for each is 5MB (our actual use-case), two processes are trying to claim the queue item at the same time, each processes query takes multiple seconds (up to 30 seconds), to get the same item and data, but only one of them will then succeed to set the expire and lock the item, thus the second process just wasted 30 seconds trying to get a lock.
We should instead, just get the item, set the expire, and then get the data.
- π³πΏNew Zealand quietone
Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies β .
The technical details in the summary contains Drupal 7 code and the patch is for Drupal 7. Tagging for an issue summary update
- Status changed to Active
about 1 month ago 2:23pm 8 April 2025 - First commit to issue fork.
- Merge request !11767Issue #3124304 only fetch queue item data when you make a successful claim β (Open) created by pwolanin
- πΊπΈUnited States pwolanin
I just opened an issue fork against 11.x and made what I think are the simple changes needed for the DatabaseQueue
- π§πͺBelgium BramDriesen Belgium π§πͺ
To add something meaningful to this issue (beside my tests above :-) ), I updated the technical details code snippet.
- πΊπΈUnited States smustgrave
Looking at the change think this makes since, if the data isn't needed why retrieve :)
- π¬π§United Kingdom catch
I think this could use a comment as to why we do two queries here so that no-one tries to 'optimize' it back to one query.
- πΊπΈUnited States pwolanin
See β¨ Track the number of times a queue item is claimed and pass as an optional param to queue workers Active which includes this change and addition improvments, though maybe not the suggested comment.
I'd like to be able to close this as duplicate if that gets commited.