From 28f77aebe6ecef3bc0859e9687ef5470423835b2 Mon Sep 17 00:00:00 2001 From: withoutaname Date: Wed, 11 Jun 2014 22:16:35 -0700 Subject: [PATCH] Deprecate $wgMasterWaitTimeout Not only was this global unused, it also caused the LoadBalancer to look for the wrong array key, which would always set $mWaitTimeout to 10 in the conditional. There is also a manual function LoadBalancer::waitTimeout() for this. Change-Id: I4b409ef890bec5aac7f666a2ed3dff9ea8bc14cc --- includes/DefaultSettings.php | 1 + includes/db/LBFactory.php | 3 +-- includes/db/LBFactoryMulti.php | 2 -- includes/db/LoadBalancer.php | 8 +------- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 6e967390cb..6d06c49c09 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1710,6 +1710,7 @@ $wgLBFactoryConf = array( 'class' => 'LBFactorySimple' ); /** * How long to wait for a slave to catch up to the master + * @deprecated since 1.24 */ $wgMasterWaitTimeout = 10; diff --git a/includes/db/LBFactory.php b/includes/db/LBFactory.php index bea195beca..168d846675 100644 --- a/includes/db/LBFactory.php +++ b/includes/db/LBFactory.php @@ -236,7 +236,7 @@ class LBFactorySimple extends LBFactory { * @return LoadBalancer */ function newMainLB( $wiki = false ) { - global $wgDBservers, $wgMasterWaitTimeout; + global $wgDBservers; if ( $wgDBservers ) { $servers = $wgDBservers; } else { @@ -267,7 +267,6 @@ class LBFactorySimple extends LBFactory { return new LoadBalancer( array( 'servers' => $servers, - 'masterWaitTimeout' => $wgMasterWaitTimeout ) ); } diff --git a/includes/db/LBFactoryMulti.php b/includes/db/LBFactoryMulti.php index 3c1885f1bc..bda3dd612a 100644 --- a/includes/db/LBFactoryMulti.php +++ b/includes/db/LBFactoryMulti.php @@ -286,11 +286,9 @@ class LBFactoryMulti extends LBFactory { * @return LoadBalancer */ function newLoadBalancer( $template, $loads, $groupLoads ) { - global $wgMasterWaitTimeout; $servers = $this->makeServerArray( $template, $loads, $groupLoads ); $lb = new LoadBalancer( array( 'servers' => $servers, - 'masterWaitTimeout' => $wgMasterWaitTimeout ) ); return $lb; diff --git a/includes/db/LoadBalancer.php b/includes/db/LoadBalancer.php index 38c3d2d9f1..ee35c13ce4 100644 --- a/includes/db/LoadBalancer.php +++ b/includes/db/LoadBalancer.php @@ -45,7 +45,6 @@ class LoadBalancer { /** * @param array $params with keys: * servers Required. Array of server info structures. - * masterWaitTimeout Replication lag wait timeout * loadMonitor Name of a class used to fetch server lag and load. * @throws MWException */ @@ -54,12 +53,7 @@ class LoadBalancer { throw new MWException( __CLASS__ . ': missing servers parameter' ); } $this->mServers = $params['servers']; - - if ( isset( $params['waitTimeout'] ) ) { - $this->mWaitTimeout = $params['waitTimeout']; - } else { - $this->mWaitTimeout = 10; - } + $this->mWaitTimeout = 10; $this->mReadIndex = -1; $this->mWriteIndex = -1; -- 2.20.1