From: jenkins-bot Date: Wed, 22 Jan 2014 22:06:12 +0000 (+0000) Subject: Merge "Provide correct type as input for LoadMonitor::postConnectionBackoff()" X-Git-Tag: 1.31.0-rc.0~17198 X-Git-Url: http://git.cyclocoop.org/data/Luca_Pacioli_%28Gemaelde%29.jpeg?a=commitdiff_plain;h=e27845d5fdbd53e6482208f3849ce83cefa67704;hp=-c;p=lhc%2Fweb%2Fwiklou.git Merge "Provide correct type as input for LoadMonitor::postConnectionBackoff()" --- e27845d5fdbd53e6482208f3849ce83cefa67704 diff --combined includes/db/LoadBalancer.php index 8268f4c2bc,c388718281..c88ad05ba2 --- a/includes/db/LoadBalancer.php +++ b/includes/db/LoadBalancer.php @@@ -29,8 -29,6 +29,8 @@@ */ class LoadBalancer { private $mServers, $mConns, $mLoads, $mGroupLoads; + + /** @var bool|DatabaseBase Database connection that caused a problem */ private $mErrorConnection; private $mReadIndex, $mAllowLagged; @@@ -278,7 -276,7 +278,7 @@@ // Perform post-connection backoff $threshold = isset( $this->mServers[$i]['max threads'] ) - ? $this->mServers[$i]['max threads'] : false; + ? $this->mServers[$i]['max threads'] : 0; $backoff = $this->getLoadMonitor()->postConnectionBackoff( $conn, $threshold ); // Decrement reference counter, we are finished with this connection. @@@ -807,7 -805,7 +807,7 @@@ /** * Returns true if the specified index is a valid server index * - * @param $i + * @param string $i * @return bool */ function haveIndex( $i ) { @@@ -817,7 -815,7 +817,7 @@@ /** * Returns true if the specified index is valid and has non-zero load * - * @param $i + * @param string $i * @return bool */ function isNonZeroLoad( $i ) { @@@ -836,7 -834,7 +836,7 @@@ /** * Get the host name or IP address of the server with the specified index * Prefer a readable name if available. - * @param $i + * @param string $i * @return string */ function getServerName( $i ) { @@@ -905,7 -903,6 +905,7 @@@ function closeAll() { foreach ( $this->mConns as $conns2 ) { foreach ( $conns2 as $conns3 ) { + /** @var DatabaseBase $conn */ foreach ( $conns3 as $conn ) { $conn->close(); } @@@ -922,7 -919,7 +922,7 @@@ * Deprecated function, typo in function name * * @deprecated in 1.18 - * @param $conn + * @param DatabaseBase $conn */ function closeConnecton( $conn ) { wfDeprecated( __METHOD__, '1.18' ); @@@ -933,7 -930,7 +933,7 @@@ * Close a connection * Using this function makes sure the LoadBalancer knows the connection is closed. * If you use $conn->close() directly, the load balancer won't update its state. - * @param $conn DatabaseBase + * @param DatabaseBase $conn */ function closeConnection( $conn ) { $done = false; @@@ -960,7 -957,6 +960,7 @@@ function commitAll() { foreach ( $this->mConns as $conns2 ) { foreach ( $conns2 as $conns3 ) { + /** @var DatabaseBase[] $conns3 */ foreach ( $conns3 as $conn ) { if ( $conn->trxLevel() ) { $conn->commit( __METHOD__, 'flush' ); @@@ -980,7 -976,6 +980,7 @@@ if ( empty( $conns2[$masterIndex] ) ) { continue; } + /** @var DatabaseBase $conn */ foreach ( $conns2[$masterIndex] as $conn ) { if ( $conn->trxLevel() && $conn->writesOrCallbacksPending() ) { $conn->commit( __METHOD__, 'flush' ); @@@ -1025,7 -1020,6 +1025,7 @@@ $success = true; foreach ( $this->mConns as $conns2 ) { foreach ( $conns2 as $conns3 ) { + /** @var DatabaseBase[] $conns3 */ foreach ( $conns3 as $conn ) { if ( !$conn->ping() ) { $success = false;