From: Aaron Schulz Date: Fri, 29 Apr 2016 19:03:50 +0000 (-0700) Subject: Avoid spamming the duplicate key fetch log in BagOStuff::merge() X-Git-Tag: 1.31.0-rc.0~7039^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/categories/modifier.php?a=commitdiff_plain;h=629f063bb9b49ce0f59ce7a50a2cae9c9594fdf5;p=lhc%2Fweb%2Fwiklou.git Avoid spamming the duplicate key fetch log in BagOStuff::merge() Change-Id: I68b10208f222f81f173f6e282c9ecf0bfcdde1fc --- 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 {