From de0e9f09c53b23c0ee4ae940fe233e85d18ba068 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sat, 29 Sep 2012 11:52:48 -0700 Subject: [PATCH] Fixed mismatched profile calls in LoadBalancer. Change-Id: I1ac81347b8af9b30dc03df94a76483a4ae4a6503 --- includes/db/LoadBalancer.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/includes/db/LoadBalancer.php b/includes/db/LoadBalancer.php index d635645723..195d4ec417 100644 --- a/includes/db/LoadBalancer.php +++ b/includes/db/LoadBalancer.php @@ -497,8 +497,8 @@ class LoadBalancer { # Couldn't find a working server in getReaderIndex()? if ( $i === false ) { $this->mLastError = 'No working slave server: ' . $this->mLastError; - $this->reportConnectionError( $this->mErrorConnection ); wfProfileOut( __METHOD__ ); + $this->reportConnectionError( $this->mErrorConnection ); return false; } } @@ -506,6 +506,7 @@ class LoadBalancer { # Now we have an explicit index into the servers array $conn = $this->openConnection( $i, $wiki ); if ( !$conn ) { + wfProfileOut( __METHOD__ ); $this->reportConnectionError( $this->mErrorConnection ); } @@ -730,8 +731,6 @@ class LoadBalancer { * @throws DBConnectionError */ function reportConnectionError( &$conn ) { - wfProfileIn( __METHOD__ ); - if ( !is_object( $conn ) ) { // No last connection, probably due to all servers being too busy wfLogDBError( "LB failure with no last connection. Connection error: {$this->mLastError}\n" ); @@ -743,7 +742,6 @@ class LoadBalancer { wfLogDBError( "Connection error: {$this->mLastError} ({$server})\n" ); $conn->reportConnectionError( "{$this->mLastError} ({$server})" ); } - wfProfileOut( __METHOD__ ); } /** -- 2.20.1