From 674858617a747d9be62622fccb8699c1f20c1aaa Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 23 Jun 2015 12:28:03 -0700 Subject: [PATCH] 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 --- includes/objectcache/SqlBagOStuff.php | 2 ++ 1 file changed, 2 insertions(+) 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] ); -- 2.20.1