From: Aaron Schulz Date: Sat, 29 Sep 2012 18:52:48 +0000 (-0700) Subject: Fixed mismatched profile calls in LoadBalancer. X-Git-Tag: 1.31.0-rc.0~22222 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=de0e9f09c53b23c0ee4ae940fe233e85d18ba068;p=lhc%2Fweb%2Fwiklou.git Fixed mismatched profile calls in LoadBalancer. Change-Id: I1ac81347b8af9b30dc03df94a76483a4ae4a6503 --- 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__ ); } /**