Merge "Fix IDEA Ultimate warnings in ChangeTags"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 20 Sep 2016 18:25:20 +0000 (18:25 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 20 Sep 2016 18:25:20 +0000 (18:25 +0000)
includes/libs/rdbms/loadbalancer/LoadBalancer.php

index c07d38f..791e5ad 100644 (file)
@@ -937,6 +937,8 @@ class LoadBalancer implements ILoadBalancer {
 
        public function closeAll() {
                $this->forEachOpenConnection( function ( IDatabase $conn ) {
+                       $host = $conn->getServer();
+                       $this->connLogger->debug( "Closing connection to database '$host'." );
                        $conn->close();
                } );
 
@@ -957,6 +959,8 @@ class LoadBalancer implements ILoadBalancer {
 
                        foreach ( $connsByServer[$serverIndex] as $i => $trackedConn ) {
                                if ( $conn === $trackedConn ) {
+                                       $host = $this->getServerName( $i );
+                                       $this->connLogger->debug( "Closing connection to database $i at '$host'." );
                                        unset( $this->mConns[$type][$serverIndex][$i] );
                                        --$this->connsOpened;
                                        break 2;