Your Queueworker trows a RequeueException, when it needs to retry sending a mail and it's not yet time for retrying it.
What I noticed is that when you run `drush cron` now, it will get stuck on this one item and just try to process it over and over again (I logged each call) and not go to the next in queue.
So either I am doing something wrong or you should just throw a RuntimeException in this case?
Or maybe a Drupal Bug with handling the RequeueException?
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | queue_mail-requeue_exception-3114513-10-D8.patch | 3.3 KB | sinn |
Comments
Comment #2
hoanns commentedComment #3
hoanns commentedComment #4
sinn commentedIt is a bug in a module.
Patch resolves the issue.
Comment #6
sinn commentedComment #8
hoanns commentedHi,
this doesn't really fix the problem. The new item will just get processed in the same queue run.
Here is what I tested:
- Create 1 item in a queue.
- In the queue worker always just recreate the item and then return
- Now when I run drush cron it processes that 1 item (and the new items it creates) around 3000 times and then stopping magically (I think because of some php timeout).
What I would expect is that each item gets only processed once per 'drush cron' call, not many times.
Comment #9
hoanns commentedComment #10
sinn commentedPlease check this solution.
Comment #11
hoanns commentedYeah looks good now and thats how I would've done it(if my opinion matters).
Sadly now you get some Exceptions in the watchdog, but I don't know any way around that and I think that's better than endless cron runs.
Comment #12
sinn commentedThank you Jan for your feedback.
There isn't another option to skip queue item processing - we should add one message to watchdog with exception or add and delete the same item to the queue during cron execution that is more expensive process.
Comment #14
sinn commented