Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/150423

Change subject: Just log exceptions instead of spamming them in JobRunner
......................................................................

Just log exceptions instead of spamming them in JobRunner

* Even the CLI script already shows the error=X snippet.
  Logging the error should be enough, and avoids showing
  output when all we want is the JSON.

Change-Id: Iade412ea61cf427865d841ecab5498e4fcdb7e13
---
M includes/jobqueue/JobRunner.php
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/23/150423/1

diff --git a/includes/jobqueue/JobRunner.php b/includes/jobqueue/JobRunner.php
index 0f585c7..9a4073f 100644
--- a/includes/jobqueue/JobRunner.php
+++ b/includes/jobqueue/JobRunner.php
@@ -51,6 +51,9 @@
         *   - elapsed  : the total time spent running tasks in ms
         *   - reached  : the reason the script finished, one of (none-ready, 
job-limit, time-limit)
         *
+        * This method outputs status information only if a debug handler was 
set.
+        * Any exceptions are caught and logged, but are not reported as output.
+        *
         * @param array $options
         * @return array Summary response that can easily be JSON serialized
         */
@@ -110,7 +113,7 @@
                                        
MWExceptionHandler::rollbackMasterChangesAndLog( $e );
                                        $status = false;
                                        $error = get_class( $e ) . ': ' . 
$e->getMessage();
-                                       $e->report(); // write error to STDERR 
and the log
+                                       MWExceptionHandler::logException( $e );
                                }
                                $timeMs = intval( ( microtime( true ) - $t ) * 
1000 );
                                wfProfileOut( __METHOD__ . '-' . get_class( 
$job ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/150423
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iade412ea61cf427865d841ecab5498e4fcdb7e13
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to