From: Aaron Schulz Date: Sat, 21 May 2016 10:40:03 +0000 (-0700) Subject: Do not count 0-load servers in getMaxLag() X-Git-Tag: 1.31.0-rc.0~6856 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=e2c75bb3bda90d091557ef250785cd3b89617201;p=lhc%2Fweb%2Fwiklou.git Do not count 0-load servers in getMaxLag() JobRunner::run() and API endpoints use this to bail out if lag is too high. A dedicated "vslow" host with no normal load should not trigger this logic, for example. Bug: T135809 Change-Id: If6879aa1a4379857779a4eacf2a8b7400c0b434f --- diff --git a/includes/db/loadbalancer/LoadBalancer.php b/includes/db/loadbalancer/LoadBalancer.php index 557809905c..1f2f494d53 100644 --- a/includes/db/loadbalancer/LoadBalancer.php +++ b/includes/db/loadbalancer/LoadBalancer.php @@ -1334,7 +1334,7 @@ class LoadBalancer { $lagTimes = $this->getLagTimes( $wiki ); foreach ( $lagTimes as $i => $lag ) { - if ( $lag > $maxLag ) { + if ( $this->mLoads[$i] > 0 && $lag > $maxLag ) { $maxLag = $lag; $host = $this->mServers[$i]['host']; $maxIndex = $i;