View Issue Details

IDProjectCategoryView StatusLast Update
0016873phplist applicationBatch Processingpublic21-07-14 14:17
Reporterduncanc 
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version3.0.3 
Target Version3.0.XFixed in Version3.0.7 
Summary0016873: Batch processing forced when processing queue using browser
DescriptionWhen processing the message queue it appears that batch processing is forced even when MAILQUEUE_BATCH_SIZE is set to 0 in config.php. That was reported in the support forum http://forums.phplist.com/viewtopic.php?f=35&t=39581

There is some confusing code in admin/actions/processqueue.php
Line 97 has this commented-out block

## force batch processing in small batches when called from the web interface
/*
 * bad idea, we shouldn't touch the batch settings, in case they are very specific for
 * ISP restrictions, instead limit webpage processing by time (below)
 *
if (empty($GLOBALS['commandline'])) {
  $num_per_batch = min($num_per_batch,100);
  $batch_period = max($batch_period,1);
} elseif (isset($cline['m'])) {
  $cl_num_per_batch = sprintf('%d',$cline['m']);
  ## don't block when the param is not a number
  if (!empty($cl_num_per_batch)) {
    $num_per_batch = $cl_num_per_batch;
  }
  cl_output("Batch set with commandline to $num_per_batch");
}
*/

But then at line 118 is this code that forces a batch size of 10000

# in-page processing force to a minute max, and make sure there's a batch size
if (empty($GLOBALS['commandline'])) {
  $maxProcessQueueTime = min($maxProcessQueueTime,60);
  if ($num_per_batch <= 0) {
    $num_per_batch = 10000;
  }
}
Later at line 469 is this code that outputs a message about batch processing being enabled. This seems to depend on $reload, but it is difficult to figure out why that is related to batch processing.

if ($num_messages) {
  if (empty($reload)) {
    output($GLOBALS['I18N']->get('Processing has started,').' '.$num_messages.' '.$GLOBALS['I18N']->get('message(s) to process.'));
  }
  clearPageCache();
  if (!$GLOBALS["commandline"] && empty($reload)) {
    if (!$safemode) {
      output($GLOBALS['I18N']->get('Please leave this window open. You have batch processing enabled, so it will reload several times to send the messages. Reports will be sent by email to').' '.getConfig("report_address"));
    } else {
      output($GLOBALS['I18N']->get('Your webserver is running in safe_mode. Please keep this window open. It may reload several times to make sure all messages are sent.').' '.$GLOBALS['I18N']->get('Reports will be sent by email to').' '.getConfig("report_address"));
    }
  }
}

TagsNo tags attached.

Activities

michiel

10-09-13 12:06

manager   ~0052264

yes, I decided to do that with the new iframed page layout. Running the sending process in a loop makes more sense.

Is the problem the confusion that it says "You have batch processing enabled"?

Basically, the batch is set to activate the code that reloads the sending process.

duncanc

02-10-13 17:37

developer   ~0052303

With phplist 2.10.x some people were able to kick-off processing the queue and then close the browser. Presumably their apache and php configuration allowed a long running process without being killed.

This is now not possible. I think that the "problem" was the reasonable expectation that after upgrading from 2.10 to 3 things would run as before.

michiel

02-10-13 21:22

manager   ~0052306

hmm, even though it was a nice and funky hack, it was really not that great for the server. Also, it is not really reliable, because the process may get killed at any time by the server. I think it was not very popular with server admins.

But if there's a big call for it, I don't mind re-instating it. I just think people should send on commandline. There's no need to involve the Webserver Daemon in the process of sending.

mario

07-11-13 15:25

reporter   ~0052413

Hello, how about batch mode on by default, if anybody wants it off then go and change it in the config file. You could add a few lines as a warning or reminder.

michiel

08-11-13 01:28

manager   ~0052415


yes, that's a good idea actually. From all points of view, it'll be much better to use batch processing all the time. Only the power-users will not want to use it, and they will know how to switch it off.