phplist

NOTE:: Before reporting an issue, make sure you are running the latest version, currently 3.3.1


View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0016765phplist applicationMessage Send Processpublic28-03-13 17:0228-03-13 19:42
Reporterduncanc 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product VersionSVN 
Target VersionFixed in Version2.11.8 
Summary0016765: process queue has incorrect units for sleeping
DescriptionWhen processing the message queue in a browser the browser window is being refreshed several times a second and records being written to the event log.

I think that this might be caused by the process sleeping for too short a period.
See file admin/actions/processqueue.php lines 227-236
====
      if ($sent + 10 < $GLOBALS["original_num_per_batch"]) {
        sleep(10); // wait 10 seconds
        output($GLOBALS['I18N']->get('Less than batch size were sent, so reloading imminently'),1,'progress');
        $delaytime = 10000;
      } else {
        output(sprintf($GLOBALS['I18N']->get('Waiting for %d seconds before reloading'),$batch_period),1,'progress');
        $delaytime = $batch_period * 1000;
      }
      //output("Do not reload this page yourself, because the next batch would fail");
      usleep($delaytime);
====
usleep expects its parameter to be in microseconds, but $delaytime is being calculated in milliseconds.

If the intention is to delay for either 10s or the batch period, then sleep() can be used whose units is seconds as there is no need to have microsecond accuracy.

Additionally, for the true part of the if statement, why is there a 10s sleep and then another sleep after the if statement?
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0052001)
michiel (manager)
28-03-13 19:42

good find!. I think the duplication was a leftover. The 10 seconds is just to avoid it reloading too often. But the usleep did that anyway.

changed to using sleep instead of usleep.


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker