Errors thrown during cron when delayed actions are not yet due for processing

Created on 26 January 2024, 10 months ago
Updated 26 March 2024, 8 months ago

Problem/Motivation

As it stands, spurious errors are thrown during cron whenever delayed actions are not yet due for processing. This will cause lots of false positives to be logged.

This appears to be due to NotYetDueForProcessingException extending Exception. In core's Cron::processQueue(), this logs an error. Instead, we probably want to just requeue our task. Throwing a RequeueException will accomplish that.

Steps to reproduce

  1. Create a model that includes an action using the eca_enqueue_task_delayed plugin ("Enqueue a task with a delay")
  2. Set the delay value to ~30 seconds; enough time to manually run cron a couple times.
  3. Manually trigger cron.
  4. Observe the following error in the log:

Drupal\eca_queue\Exception\NotYetDueForProcessingException: Task is not yet due for processing. in Drupal\eca_queue\Plugin\QueueWorker\TaskWorker->processItem() (line 83 of /var/www/html/web/modules/contrib/eca/modules/queue/src/Plugin/QueueWorker/TaskWorker.php).

Proposed resolution

Have NotYetDueForProcessingException extend RequeueException.

Remaining tasks

Roll a patch.

User interface changes

N/A

API changes

N/A?

Data model changes

N/A

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇨🇦Canada ergonlogic Montréal, Québec 🇨🇦

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024