From: Platonides Date: Tue, 19 Apr 2011 17:59:59 +0000 (+0000) Subject: (Bug 28611) Don't die in SqlBagOStuff::incr() if there's a race condition. X-Git-Tag: 1.31.0-rc.0~30700 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_add%27%29%20%7D%7D?a=commitdiff_plain;h=ec455d68fa14e66e3f4fd54b2ac8381fe151c3fd;p=lhc%2Fweb%2Fwiklou.git (Bug 28611) Don't die in SqlBagOStuff::incr() if there's a race condition. --- diff --git a/includes/objectcache/SqlBagOStuff.php b/includes/objectcache/SqlBagOStuff.php index 10f42cdcd8..6952cdf0a3 100644 --- a/includes/objectcache/SqlBagOStuff.php +++ b/includes/objectcache/SqlBagOStuff.php @@ -188,7 +188,12 @@ class SqlBagOStuff extends BagOStuff { 'keyname' => $key, 'value' => $db->encodeBlob( $this->serialize( $newValue ) ), 'exptime' => $row->exptime - ), __METHOD__ ); + ), __METHOD__, 'IGNORE' ); + + if ( $db->affectedRows() == 0 ) { + // Race condition. See bug 28611 + $newValue = null; + } $db->commit(); } catch ( DBQueryError $e ) { $this->handleWriteError( $e );