jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/390990 )

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
---
M includes/DataSender.php
1 file changed, 4 insertions(+), 1 deletion(-)

Approvals:
  Cindy-the-browser-test-bot: Looks good to me, but someone else must approve
  EBernhardson: Looks good to me, approved
  jenkins-bot: Verified
  Nikerabbit: Looks good to me, but someone else must approve



diff --git a/includes/DataSender.php b/includes/DataSender.php
index a539d5f..ac63484 100644
--- a/includes/DataSender.php
+++ b/includes/DataSender.php
@@ -207,10 +207,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/390990
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6ca58270e2ab001fab02275636a237449c528fc8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: DCausse <dcau...@wikimedia.org>
Gerrit-Reviewer: Cindy-the-browser-test-bot <bernhardsone...@gmail.com>
Gerrit-Reviewer: EBernhardson <ebernhard...@wikimedia.org>
Gerrit-Reviewer: Gehel <guillaume.leder...@wikimedia.org>
Gerrit-Reviewer: Nikerabbit <niklas.laxst...@gmail.com>
Gerrit-Reviewer: Smalyshev <smalys...@wikimedia.org>
Gerrit-Reviewer: Tjones <tjo...@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