View Issue Details

IDProjectCategoryView StatusLast Update
0014241phplist applicationBatch Processingpublic08-11-12 11:57
Reporterplumbley 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.10.5 
Target Version4.0.xFixed in Version2.11.8 
Summary0014241: Bogus negative last batch size if zero batch period while nonzero batch size
DescriptionNonzero batch size with zero batch period produces an odd report during processqueue. Example:
 define("MAILQUEUE_BATCH_SIZE",250);
 define("MAILQUEUE_BATCH_PERIOD",0);
(Reason: using MAILQUEUE_THROTTLE with hourly cron to control batches)

With this (and none to process) process queue reports:
----
Started
Sending in batches of emails
This batch will be 250 emails, because in the last 0 seconds -250 emails were sent
...
---
This problem does not happen if MAILQUEUE_BATCH_PERIOD is set to 1

Diagnosis: processqueue.php line 99-

if ($num_per_batch && $batch_period) {
  $original_num_per_batch = $num_per_batch;
  ...
}

Then lines 296-300:
if ($num_per_batch > 0) {
  ...
  if ($original_num_per_batch != $num_per_batch) {
  ... [batch size difference report]
}

But if $batch_period was zero then $original_num_per_batch is never set.

Maybe fix by setting $original_num_per_batch = $num_per_batch outside of the first test? Or specifically not assume both are nonzero for batch processing?

Best wishes, Mark
TagsNo tags attached.

Activities

michiel

08-11-12 11:57

manager   ~0051876

yes, seems fairly safe to put the assignment before the condition

revision3424