Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 296300

Add a way to silently keep an item locked when processing a queue via cron

$
0
0

Problem/motivation

When processing items in a queue, sometimes it is useful to delay further processing of an item due to uncontrollable external circumstances. Unfortunately, this isn't possible with the current queue worker processing via cron since RequeueException immediately re-queues an item (which causes an infinite loop depending on queue implementation) and all other exceptions trigger a log message to be stored via watchdog.

Proposed resolution

I propose introducing a new exception, DelayedRequeueException to behave similarly to RequeueException except that the item being processed is not released via QueueInterface::releaseItem(). This would allow for an in-built back-off delay in the further processing of queue items without requiring a custom queue implementation.

Backward compatibility

No backward-incompatible changes should be required as the only change to Drupal will be to add a new exception. If a queue runner is compatible with the only queue runner in core, Cron::processQueue then this will cause no problems as the only change between throwing just \Exception and the new exception is the lack of logging. For the same reason, no new functionality needs to be aded to queue backends.


Viewing all articles
Browse latest Browse all 296300


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>