View Issue Details

IDProjectCategoryView StatusLast Update
0017276phpList 3 applicationCampaign Send Processpublic23-07-14 16:29
Reporterduncanc Assigned To 
Status resolvedResolutionfixed 
Product Version3.0.6 
Fixed in Version3.0.7 
Summary0017276: Campaign incorrectly marked as sent
DescriptionThere is a problem when phplist processes more than one campaign in a run. If the first message completes, i.e. it has been sent to all subscribers, then it is marked as 'sent'.

But then the second message can also immediately be marked as 'sent'.

This seems to be caused by the variable $sent, which is used to hold the total number of emails sent across all messages,
see line 818 for an example
    if ($num_per_batch && $sent >= $num_per_batch) {

But $sent is also used to decide whether an individual message is complete.

See line 1170
  if ($counters['total_users_for_message '.$messageid] - $sent <= 0 || $stopSending) {

So if the first message has been sent to more subscribers than the second message then the second will also be marked as complete.

There might be problems with the other variables such as $notsent, but I have not tried to follow those through.
TagsNo tags attached.



23-07-14 15:12

administrator   ~0054376

there must be more to it, I can't replicate this.

I had two campaigns, each going out to 4 subscribers in the queue.

I had the first one sent to 3 subscribers, and then set the batch size to 2.

It sent the first campaign, one subscriber, marked the campaign sent, and then sent the second one to one subscriber, but did not mark the campaign sent. In the next run it continued on the next campaign.

phpList - Started [0.0025670000] (104)
phpList - Sending in batches of 2 emails [0.0003870000] (105)
phpList - Processing has started, 2 message(s) to process. [0.0024170000] (109)
phpList - Processing message 495 [0.0155500000] (124)
phpList - Looking for subscribers [0.0051140000] (129)
phpList - found pre-queued subscribers 1
phpList - Found them: 1 to process [0.0039760000] (135)
phpList - Processing batch of: 1 [0.0024070000] (139)
phpList - Size of HTML email: 8Kb [0.0549590000] (176)
phpList - Processed 1 out of 1 subscribers [0.0040420000] (183)
phpList - It took 1 minutes 28 seconds to send this message [0.0034990000] (191)
phpList - Processing message 496 [0.0322700000] (199)
phpList - Looking for subscribers [0.0020870000] (203)
phpList - found pre-queued subscribers 4
phpList - Found them: 4 to process [0.0019070000] (207)
phpList - Processing batch of: 1 [0.0014390000] (210)
phpList - batch limit reached: 1 (1) [0.0004080000] (211)
phpList - Script stage: 5 [0.0008980000] (213)
phpList - 1 messages sent in 0.13 seconds (26867 msgs/hr) [0.0011650000] (216)
phpList - Finished this run [0.0015400000] (220)


23-07-14 15:45

updater   ~0054379

It is a little bit more complex than I described.

It looks like the first campaign has to complete sending together with the batch size being met. Then it appears that the second message is not sent because the batch size has already been met, but it is still marked as "sent".

list A has 3 subscribers
list B has 2 subscribers
batch size is 3
send first campaign to list A
send second campaign to list B
process the queue
both campaigns are marked as "sent" but the second message has not been sent to list B subscribers

at line 1170 of actions/processqueue, when the second message is processed $sent already has a value of 3, which applies to the first message, but that is being compared to the value of 2 (members of list B).

There is some processing at line 794 to do with batch size, which might be relevant too.


23-07-14 16:08

administrator   ~0054380

yes, managed to replicate it.


23-07-14 16:29

administrator   ~0054381