View Issue Details

IDProjectCategoryView StatusLast Update
0018544phpList 3 applicationMessage Send Processpublic25-10-18 19:03
Reporterduncanc 
PrioritynormalSeverityminorReproducibilitysometimes
Status newResolutionopen 
Product Version 
Target Version3.4.0Fixed in Version 
Summary0018544: Process queue not terminating
DescriptionThis is a bit of an edge case but has happened a few times.

When a plugin uses the canSend() method to accept/reject sending to subscribers, that can lead to there being no subscribers to send to at all. Maybe when batch processing is used and the final batch has no subscribers accepted.

The shutdown processing of processqueue then outputs

Warning: script never reached stage 5
This may be caused by a too slow or too busy server

and processqueue continues indefinitely.

The code is a bit convoluted but this seems to be happen when some subscribers have been processed (that includes those rejected) but there have been no attempts at sending (which seems to be when moving to stage 5 happens).

Possibly moving to stage 5 should also happen when a plugin rejects sending to a subscriber.
TagsNo tags attached.

Relationships

related to 0019485 new Processing queued campaigns loads forever despite successfully sending the message 

Activities

duncanc

23-02-17 06:29

developer  

suela

02-07-18 13:08

administrator   ~0060824

https://discuss.phplist.org/t/campaign-finished-too-early-after-200-300-or-400-emails-out-of-2498/2930/20

mktcps

20-10-18 16:08

reporter   ~0061258

Hi,
I am affected by this bug and would like to ask whether there is any workaround possible, please?

I am able to reproduce the bug using **Autoresponder** and **Segmentation**. As soon as the Autoresponder decide to send a message to a new user (e.g. after 2 days after s/he signed in) but the user does not match the Segmentation criteria, it gets stuck in this situation and cannot overcome it:

$ ./phplist -p processqueue
phpList - phpList version 3.3.3 (c) 2000-2018 phpList Ltd, https://www.phplist.com
phpList version 3.3.3 (c) 2000-2018 phpList Ltd, https://www.phplist.comphpList - Recently sent : 0
phpList - Started [0.3281530000] (123)
phpList - Sending in batches of 1 emails [0.0004060000] (124)
phpList - Processing has started, [0.0009030000] (127)
phpList - One campaign to process. [0.0696310000] (129)
phpList - Processing campaign 121 [0.3071640000] (150)
phpList - Looking for subscribers [0.0502570000] (155)
phpList - Found them: 6687 to process [0.0584820000] (161)
phpList - Processed 6687 out of 6687 subscribers [206.7292610000] (80410)
phpList - It took 12 hours 11 minutes 06 seconds to send this message [0.0107980000] (80418)
phpList - Script stage: 4 [0.0039600000] (80420)
phpList - Finished this run [0.0063990000] (80425)
phpList - Warning: script never reached stage 5
This may be caused by a too slow or too busy server
 [0.3654040000] (80445)

Isn't there any (even ugly on a php or mysql level) workaround to skip this?

Thanks a lot
Mark

samtuke

20-10-18 16:12

administrator   ~0061259

@mktcps Not aware of a workaround; sorry. @duncanc understands the issue best.

duncanc

21-10-18 07:02

developer   ~0061263

You can try a small modification to the phplist code
file actions/processqueue.php

line 1248 is
                    ++$cannotsend;

Add this immediately after

                    if ($script_stage < 5) {
                        $script_stage = 5;
                    }

The intention is to make the code think that is has successfully processed the subscriber.
But the code is convoluted so it is a bit difficult to predict the actual effect.

mktcps

23-10-18 07:16

reporter   ~0061271

Hi,
So far so good.
 
phpList - phpList version 3.3.3 (c) 2000-2018 phpList Ltd, https://www.phplist.com
phpList version 3.3.3 (c) 2000-2018 phpList Ltd, https://www.phplist.comphpList - Recently sent : 0
phpList - Started [0.5653630000] (126)
phpList - Sending in batches of 1 emails [0.0004570000] (127)
phpList - Processing has started, [0.0011100000] (130)
phpList - One campaign to process. [0.0925860000] (132)
phpList - Processing campaign 121 [0.6924620000] (153)
phpList - Looking for subscribers [0.0345880000] (158)
phpList - Found them: 6674 to process [0.1045710000] (164)
phpList - It took 3 days 4 minutes 06 seconds to send this message [0.0153990000] (80265)
phpList - Script stage: 5 [0.0072440000] (80267)
phpList - Finished this run [0.0080920000] (80272)

And the email got sent.
 
Thanks a lot!