Issue #2356983 by bzrudi71, Dave Reid, jaredsmith: SystemQueue::claimItem()...
Issue #2356983 by bzrudi71, Dave Reid, jaredsmith: SystemQueue::claimItem() sometimes returns items in the wrong order (resolves locale test failures on PostgreSQL)
Changes for modules/system/system.queue.inc: 1 added line, 1 removed line.
Original line number
Diff line number
Diff line
@@ -231,7 +231,7 @@ public function claimItem($lease_time = 30) {
// until an item is successfully claimed or we are reasonably sure there
// are no unclaimed items left.
while(TRUE){
$item=db_query_range('SELECT data, item_id FROM {queue} q WHERE expire = 0 AND name = :name ORDER BY created ASC',0,1,array(':name'=>$this->name))->fetchObject();
$item=db_query_range('SELECT data, item_id FROM {queue} q WHERE expire = 0 AND name = :name ORDER BY created, item_id ASC',0,1,array(':name'=>$this->name))->fetchObject();
if($item){
// Try to update the item. Only one thread can succeed in UPDATEing the
// same row. We cannot rely on REQUEST_TIME because items might be