jenkins-bot has submitted this change and it was merged.

Change subject: Add debugging logging to LoadBalancer connection closes
......................................................................


Add debugging logging to LoadBalancer connection closes

This matches the logging used for opening new connections and can be
useful for seeing connection leakage.

Change-Id: I8d24d059062f3b698e64751b46542eb1fa78bb36
---
M includes/libs/rdbms/loadbalancer/LoadBalancer.php
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Jforrester: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/libs/rdbms/loadbalancer/LoadBalancer.php 
b/includes/libs/rdbms/loadbalancer/LoadBalancer.php
index c07d38f..791e5ad 100644
--- a/includes/libs/rdbms/loadbalancer/LoadBalancer.php
+++ b/includes/libs/rdbms/loadbalancer/LoadBalancer.php
@@ -937,6 +937,8 @@
 
        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 @@
 
                        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;

-- 
To view, visit https://gerrit.wikimedia.org/r/311748
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8d24d059062f3b698e64751b46542eb1fa78bb36
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <asch...@wikimedia.org>
Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to