From: Aaron Schulz Date: Tue, 23 Jun 2015 19:28:03 +0000 (-0700) Subject: Made SqlBagOStuff unset DB handles on connection errors X-Git-Tag: 1.31.0-rc.0~10939^2 X-Git-Url: http://git.cyclocoop.org/%22.%24redirect_annul.%22?a=commitdiff_plain;h=674858617a747d9be62622fccb8699c1f20c1aaa;p=lhc%2Fweb%2Fwiklou.git Made SqlBagOStuff unset DB handles on connection errors * A "gone away" error can trigger ping(), which can fail, triggering a full open(). If this fails (as it often will), mConn is false and the DatabaseBase object is not usable. Bug: T103435 Change-Id: Id2aaed87d2642e73c7811076da908180ee5ab5a4 --- diff --git a/includes/objectcache/SqlBagOStuff.php b/includes/objectcache/SqlBagOStuff.php index b8c1e75068..a80c68f5b3 100644 --- a/includes/objectcache/SqlBagOStuff.php +++ b/includes/objectcache/SqlBagOStuff.php @@ -756,6 +756,8 @@ class SqlBagOStuff extends BagOStuff { * @param int $serverIndex */ protected function markServerDown( $exception, $serverIndex ) { + unset( $this->conns[$serverIndex] ); // bug T103435 + if ( isset( $this->connFailureTimes[$serverIndex] ) ) { if ( time() - $this->connFailureTimes[$serverIndex] >= 60 ) { unset( $this->connFailureTimes[$serverIndex] );