From 629f063bb9b49ce0f59ce7a50a2cae9c9594fdf5 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 29 Apr 2016 12:03:50 -0700 Subject: [PATCH] Avoid spamming the duplicate key fetch log in BagOStuff::merge() Change-Id: I68b10208f222f81f173f6e282c9ecf0bfcdde1fc --- includes/libs/objectcache/BagOStuff.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/includes/libs/objectcache/BagOStuff.php b/includes/libs/objectcache/BagOStuff.php index 8e3c0a5f36..bf46ce1648 100644 --- a/includes/libs/objectcache/BagOStuff.php +++ b/includes/libs/objectcache/BagOStuff.php @@ -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 { -- 2.20.1