FIX: memory exhaustion on exceptionally large message queues & multiple...
FIX: memory exhaustion on exceptionally large message queues & multiple Queue.php invocations duplicate work
There are 2 issues fixed by this patch:
If for some reason there is an exceptionally large number of items to be processed in this invocation of Queue.php, the select statement can exhaust memory, meaning no queue items are processed. Items may still "trickle" out until $config['system']['force_queue_threshold'] is met. At that time, all queue processing will end up stop entirely and all deliveries will be deferred.
If for some reason the processing of Queue.php is begun while a previous invocation of Queue.php is in process, the second invocation will simply duplicate the work done by the first and, in spite of the processing and network activity expended, no additional work will be done.
THE FIX: Randomizes the order of the delivery list and selects only a single item from the queue at a time rather than retrieving the entire queue at the start of processing.