Problem/Motivation

When using the "Override cron queue processing" feature to process queues using ultimate_cron, if the queue worker throws a SuspendQueueException exception the exception is caught in QueueWorker.php (line 117) and does not 'bubble up' which causes the queue to reprocess the item until cron times out, resulting in a flood of the watchdog table and over-processing without an end.

Steps to reproduce

Enable the "Override cron queue processing" and process a queue that throws a SuspendQueueException exception.

Proposed resolution

After catching the SuspendQueueException exception and releasing the item, throw it again so that it is caught and stops the processing of the queue during that cron run.

Remaining tasks

A patch will shortly be attached.

User interface changes

None.

API changes

None.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

asak created an issue. See original summary.

asak’s picture

andreasderijcke’s picture

Status: Active » Reviewed & tested by the community

I confirm both the issue and the patch resulting in the expected behaviour.

Berdir’s picture

why create a new exception and not just do throw $e?

adr_p’s picture

I agree with Berdir, updated the patch.

  • Berdir committed 97c1262 on 8.x-2.x
    Issue #3163704 by asak, adr_p: Queue cron is stuck in a loop due to...
Berdir’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed. Make sure you create your patches with the a/b prefix so that it can be applied with the default settings of git apply.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.