From: Aaron Schulz Date: Wed, 21 Sep 2016 07:58:14 +0000 (-0700) Subject: Use getConnectionRef() in ExternalStoreDB to avoid connection leaks X-Git-Tag: 1.31.0-rc.0~5425^2 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=0ceb2f8d4cc22011fffc1ff4a25fb9f0c81f41ac;p=lhc%2Fweb%2Fwiklou.git Use getConnectionRef() in ExternalStoreDB to avoid connection leaks Change-Id: I3df270241653841a4fb2f65e240aae9d2e0b650f --- diff --git a/includes/externalstore/ExternalStoreDB.php b/includes/externalstore/ExternalStoreDB.php index 2eae279be5..7e932994e6 100644 --- a/includes/externalstore/ExternalStoreDB.php +++ b/includes/externalstore/ExternalStoreDB.php @@ -130,7 +130,7 @@ class ExternalStoreDB extends ExternalStoreMedium { wfDebug( "writable external store\n" ); } - $db = $lb->getConnection( DB_REPLICA, [], $wiki ); + $db = $lb->getConnectionRef( DB_REPLICA, [], $wiki ); $db->clearFlag( DBO_TRX ); // sanity return $db; @@ -146,7 +146,7 @@ class ExternalStoreDB extends ExternalStoreMedium { $wiki = isset( $this->params['wiki'] ) ? $this->params['wiki'] : false; $lb = $this->getLoadBalancer( $cluster ); - $db = $lb->getConnection( DB_MASTER, [], $wiki ); + $db = $lb->getConnectionRef( DB_MASTER, [], $wiki ); $db->clearFlag( DBO_TRX ); // sanity return $db;