Merge "Avoid spamming the duplicate key fetch log in BagOStuff::merge()"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 10 May 2016 12:33:23 +0000 (12:33 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 10 May 2016 12:33:23 +0000 (12:33 +0000)
includes/libs/objectcache/BagOStuff.php

index 8e3c0a5..bf46ce1 100644 (file)
@@ -285,8 +285,12 @@ abstract class BagOStuff implements IExpiringStore, LoggerAwareInterface {
        protected function mergeViaCas( $key, $callback, $exptime = 0, $attempts = 10 ) {
                do {
                        $this->clearLastError();
+                       $reportDupes = $this->reportDupes;
+                       $this->reportDupes = false;
                        $casToken = null; // passed by reference
                        $currentValue = $this->getWithToken( $key, $casToken, self::READ_LATEST );
+                       $this->reportDupes = $reportDupes;
+
                        if ( $this->getLastError() ) {
                                return false; // don't spam retries (retry only on races)
                        }
@@ -342,7 +346,11 @@ abstract class BagOStuff implements IExpiringStore, LoggerAwareInterface {
                }
 
                $this->clearLastError();
+               $reportDupes = $this->reportDupes;
+               $this->reportDupes = false;
                $currentValue = $this->get( $key, self::READ_LATEST );
+               $this->reportDupes = $reportDupes;
+
                if ( $this->getLastError() ) {
                        $success = false;
                } else {