Deprecate $wgMasterWaitTimeout
authorwithoutaname <drevitchi@gmail.com>
Thu, 12 Jun 2014 05:16:35 +0000 (22:16 -0700)
committerwithoutaname <drevitchi@gmail.com>
Thu, 12 Jun 2014 05:24:07 +0000 (22:24 -0700)
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
includes/db/LBFactory.php
includes/db/LBFactoryMulti.php
includes/db/LoadBalancer.php

index 6e96739..6d06c49 100644 (file)
@@ -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;
 
index bea195b..168d846 100644 (file)
@@ -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
                ) );
        }
 
index 3c1885f..bda3dd6 100644 (file)
@@ -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;
index 38c3d2d..ee35c13 100644 (file)
@@ -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;