Made --maxtime a soft limit again
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 18 Jul 2014 18:01:01 +0000 (11:01 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 18 Jul 2014 18:01:01 +0000 (11:01 -0700)
* The new job loop already manages timeouts and this version caused
  some problems with the time-sharing approach that used --maxtime.
  This killed runners too fast for some jobs and only handled CPU
  time anyway, not wall clock time.

Change-Id: Id3462554b1ecba9ecdf7d49673645d54c0555cd6

maintenance/runJobs.php

index 1383a8a..423ae61 100644 (file)
@@ -101,8 +101,6 @@ class RunJobs extends Maintenance {
                                ++$jobsRun;
                                $this->runJobsLog( $job->toString() . " STARTING" );
 
-                               // Set timer to stop the job if too much CPU time is used
-                               set_time_limit( $maxTime ? : 0 );
                                // Run the job...
                                wfProfileIn( __METHOD__ . '-' . get_class( $job ) );
                                $t = microtime( true );
@@ -117,8 +115,6 @@ class RunJobs extends Maintenance {
                                }
                                $timeMs = intval( ( microtime( true ) - $t ) * 1000 );
                                wfProfileOut( __METHOD__ . '-' . get_class( $job ) );
-                               // Disable the timer
-                               set_time_limit( 0 );
 
                                // Mark the job as done on success or when the job cannot be retried
                                if ( $status !== false || !$job->allowRetries() ) {