Moved JobQueueFederated partition exceptions to their own log
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 2 Mar 2015 19:15:40 +0000 (11:15 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Mon, 2 Mar 2015 19:15:40 +0000 (11:15 -0800)
Change-Id: If495e9b1a631b587cb3b8d83974837eef1d2d4c6

includes/jobqueue/JobQueueFederated.php

index 4186204..246c06e 100644 (file)
@@ -160,7 +160,7 @@ class JobQueueFederated extends JobQueue {
                                $empty = $empty && $queue->doIsEmpty();
                        } catch ( JobQueueError $e ) {
                                ++$failed;
-                               MWExceptionHandler::logException( $e );
+                               $this->logException( $e );
                        }
                }
                $this->throwErrorIfAllPartitionsDown( $failed );
@@ -204,7 +204,7 @@ class JobQueueFederated extends JobQueue {
                                $count += $queue->$method();
                        } catch ( JobQueueError $e ) {
                                ++$failed;
-                               MWExceptionHandler::logException( $e );
+                               $this->logException( $e );
                        }
                }
                $this->throwErrorIfAllPartitionsDown( $failed );
@@ -277,7 +277,7 @@ class JobQueueFederated extends JobQueue {
                                $queue->doBatchPush( $jobBatch, $flags | self::QOS_ATOMIC );
                        } catch ( JobQueueError $e ) {
                                $ok = false;
-                               MWExceptionHandler::logException( $e );
+                               $this->logException( $e );
                        }
                        if ( $ok ) {
                                $key = $this->getCacheKey( 'empty' );
@@ -299,7 +299,7 @@ class JobQueueFederated extends JobQueue {
                                $queue->doBatchPush( $jobBatch, $flags | self::QOS_ATOMIC );
                        } catch ( JobQueueError $e ) {
                                $ok = false;
-                               MWExceptionHandler::logException( $e );
+                               $this->logException( $e );
                        }
                        if ( $ok ) {
                                $key = $this->getCacheKey( 'empty' );
@@ -331,7 +331,7 @@ class JobQueueFederated extends JobQueue {
                                $job = $queue->pop();
                        } catch ( JobQueueError $e ) {
                                ++$failed;
-                               MWExceptionHandler::logException( $e );
+                               $this->logException( $e );
                                $job = false;
                        }
                        if ( $job ) {
@@ -398,7 +398,7 @@ class JobQueueFederated extends JobQueue {
                                $queue->doDelete();
                        } catch ( JobQueueError $e ) {
                                ++$failed;
-                               MWExceptionHandler::logException( $e );
+                               $this->logException( $e );
                        }
                }
                $this->throwErrorIfAllPartitionsDown( $failed );
@@ -413,7 +413,7 @@ class JobQueueFederated extends JobQueue {
                                $queue->waitForBackups();
                        } catch ( JobQueueError $e ) {
                                ++$failed;
-                               MWExceptionHandler::logException( $e );
+                               $this->logException( $e );
                        }
                }
                $this->throwErrorIfAllPartitionsDown( $failed );
@@ -495,7 +495,7 @@ class JobQueueFederated extends JobQueue {
                                }
                        } catch ( JobQueueError $e ) {
                                ++$failed;
-                               MWExceptionHandler::logException( $e );
+                               $this->logException( $e );
                        }
                }
                $this->throwErrorIfAllPartitionsDown( $failed );
@@ -519,7 +519,7 @@ class JobQueueFederated extends JobQueue {
                                }
                        } catch ( JobQueueError $e ) {
                                ++$failed;
-                               MWExceptionHandler::logException( $e );
+                               $this->logException( $e );
                        }
                }
                $this->throwErrorIfAllPartitionsDown( $failed );
@@ -527,6 +527,10 @@ class JobQueueFederated extends JobQueue {
                return $result;
        }
 
+       protected function logException( Exception $e ) {
+               wfDebugLog( 'JobQueueFederated', $e->getMessage() . "\n" . $e->getTraceAsString() );
+       }
+
        /**
         * Throw an error if no partitions available
         *