Merge "Use getConnectionRef() in ExternalStoreDB to avoid connection leaks"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 21 Sep 2016 08:08:27 +0000 (08:08 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 21 Sep 2016 08:08:27 +0000 (08:08 +0000)
includes/externalstore/ExternalStoreDB.php

index 2eae279..7e93299 100644 (file)
@@ -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;