Merge "Removed overzealous caching from JobQueueFederated"
[lhc/web/wiklou.git] / includes / jobqueue / JobQueueFederated.php
index 40936b7..a0a4b7b 100644 (file)
@@ -143,7 +143,7 @@ class JobQueueFederated extends JobQueue {
                                $empty = $empty && $queue->doIsEmpty();
                        } catch ( JobQueueError $e ) {
                                ++$failed;
-                               MWExceptionHandler::logException( $e );
+                               $this->logException( $e );
                        }
                }
                $this->throwErrorIfAllPartitionsDown( $failed );
@@ -180,7 +180,7 @@ class JobQueueFederated extends JobQueue {
                                $count += $queue->$method();
                        } catch ( JobQueueError $e ) {
                                ++$failed;
-                               MWExceptionHandler::logException( $e );
+                               $this->logException( $e );
                        }
                }
                $this->throwErrorIfAllPartitionsDown( $failed );
@@ -251,7 +251,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 ) {
                                if ( !$partitionRing->ejectFromLiveRing( $partition, 5 ) ) { // blacklist
@@ -270,7 +270,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 ) {
                                if ( !$partitionRing->ejectFromLiveRing( $partition, 5 ) ) { // blacklist
@@ -299,7 +299,7 @@ class JobQueueFederated extends JobQueue {
                                $job = $queue->pop();
                        } catch ( JobQueueError $e ) {
                                ++$failed;
-                               MWExceptionHandler::logException( $e );
+                               $this->logException( $e );
                                $job = false;
                        }
                        if ( $job ) {
@@ -363,7 +363,7 @@ class JobQueueFederated extends JobQueue {
                                $queue->doDelete();
                        } catch ( JobQueueError $e ) {
                                ++$failed;
-                               MWExceptionHandler::logException( $e );
+                               $this->logException( $e );
                        }
                }
                $this->throwErrorIfAllPartitionsDown( $failed );
@@ -378,7 +378,7 @@ class JobQueueFederated extends JobQueue {
                                $queue->waitForBackups();
                        } catch ( JobQueueError $e ) {
                                ++$failed;
-                               MWExceptionHandler::logException( $e );
+                               $this->logException( $e );
                        }
                }
                $this->throwErrorIfAllPartitionsDown( $failed );
@@ -456,7 +456,7 @@ class JobQueueFederated extends JobQueue {
                                }
                        } catch ( JobQueueError $e ) {
                                ++$failed;
-                               MWExceptionHandler::logException( $e );
+                               $this->logException( $e );
                        }
                }
                $this->throwErrorIfAllPartitionsDown( $failed );
@@ -480,7 +480,7 @@ class JobQueueFederated extends JobQueue {
                                }
                        } catch ( JobQueueError $e ) {
                                ++$failed;
-                               MWExceptionHandler::logException( $e );
+                               $this->logException( $e );
                        }
                }
                $this->throwErrorIfAllPartitionsDown( $failed );
@@ -488,6 +488,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
         *