jenkins-bot has submitted this change and it was merged.

Change subject: JobQueueRedis::doBatchPush(): report metrics even when failures 
occur
......................................................................


JobQueueRedis::doBatchPush(): report metrics even when failures occur

The way the method is currently written, no stats are reported at all when
failures occur.

Change-Id: I627e8f6ce3a59098bc8949da7ed22f5c924177fc
---
M includes/jobqueue/JobQueueRedis.php
1 file changed, 5 insertions(+), 5 deletions(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/jobqueue/JobQueueRedis.php 
b/includes/jobqueue/JobQueueRedis.php
index 419ed0e..1e957c2 100644
--- a/includes/jobqueue/JobQueueRedis.php
+++ b/includes/jobqueue/JobQueueRedis.php
@@ -218,15 +218,15 @@
                                        $failed += count( $itemBatch );
                                }
                        }
-                       if ( $failed > 0 ) {
-                               wfDebugLog( 'JobQueueRedis', "Could not insert 
{$failed} {$this->type} job(s)." );
-
-                               throw new RedisException( "Could not insert 
{$failed} {$this->type} job(s)." );
-                       }
                        JobQueue::incrStats( 'inserts', $this->type, count( 
$items ) );
                        JobQueue::incrStats( 'inserts_actual', $pushed );
                        JobQueue::incrStats( 'dupe_inserts', $this->type,
                                count( $items ) - $failed - $pushed );
+                       if ( $failed > 0 ) {
+                               $err = "Could not insert {$failed} 
{$this->type} job(s).";
+                               wfDebugLog( 'JobQueueRedis', $err );
+                               throw new RedisException( $err );
+                       }
                } catch ( RedisException $e ) {
                        $this->throwRedisException( $conn, $e );
                }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I627e8f6ce3a59098bc8949da7ed22f5c924177fc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <o...@wikimedia.org>
Gerrit-Reviewer: Aaron Schulz <asch...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to