From: jenkins-bot Date: Sun, 25 Aug 2019 16:57:41 +0000 (+0000) Subject: Merge "objectcache: make MediumSpecificBagOStuff::mergeViaCas() handle negative TTLs" X-Git-Tag: 1.34.0-rc.0~589 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/D%D1%83%D0%BD%D0%B0?a=commitdiff_plain;h=4334e1cc02b9749e92c514bd2aa46b347010f913;p=lhc%2Fweb%2Fwiklou.git Merge "objectcache: make MediumSpecificBagOStuff::mergeViaCas() handle negative TTLs" --- 4334e1cc02b9749e92c514bd2aa46b347010f913 diff --cc includes/libs/objectcache/MediumSpecificBagOStuff.php index cb3f621f8f,5e9ebcab03..9d361876ce --- a/includes/libs/objectcache/MediumSpecificBagOStuff.php +++ b/includes/libs/objectcache/MediumSpecificBagOStuff.php @@@ -293,11 -323,9 +293,11 @@@ abstract class MediumSpecificBagOStuff unset( $currentValue ); // free RAM in case the value is large $this->clearLastError(); - if ( $value === false ) { + if ( $value === false || $exptime < 0 ) { $success = true; // do nothing - } elseif ( $hadNoCurrentValue ) { + } elseif ( $valueMatchesOldValue && $attemptsLeft !== $attempts ) { + $success = true; // recently set by another thread to the same value + } elseif ( $keyWasNonexistant ) { // Try to create the key, failing if it gets created in the meantime $success = $this->add( $key, $value, $exptime, $flags ); } else {