DCausse has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/392002 )

Change subject: Don't try to report update metrics if the response is not valid
......................................................................

Don't try to report update metrics if the response is not valid

Seen in logs where a null $responseSet is being sent to reportUpdateMetrics.
The only case where it could happen is when we detect documentMissing
exceptions.

Bug: T180298
Change-Id: I6ca58270e2ab001fab02275636a237449c528fc8
(cherry picked from commit 81a99cd1478997d3b9764165511b14e9d4a13dff)
---
M includes/DataSender.php
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch 
refs/changes/02/392002/1

diff --git a/includes/DataSender.php b/includes/DataSender.php
index 88c9206..6900bb1 100644
--- a/includes/DataSender.php
+++ b/includes/DataSender.php
@@ -203,10 +203,13 @@
                        $exception = $e;
                }
 
+               // TODO: rewrite error handling, the logic here is hard to 
follow
                $validResponse = $responseSet !== null && count( 
$responseSet->getBulkResponses() ) > 0;
                if ( $exception === null && ( $justDocumentMissing || 
$validResponse ) ) {
                        $this->success();
-                       $this->reportUpdateMetrics( $responseSet, $indexType, 
count( $data ) );
+                       if ( $validResponse ) {
+                               $this->reportUpdateMetrics( $responseSet, 
$indexType, count( $data ) );
+                       }
                        return Status::newGood();
                } else {
                        $this->failure( $exception );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6ca58270e2ab001fab02275636a237449c528fc8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: REL1_29
Gerrit-Owner: DCausse <dcau...@wikimedia.org>

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

Reply via email to