rdbms: make LoadBalancer::doWait() cast $timeout to an integer
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 29 Mar 2018 02:42:31 +0000 (19:42 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Sat, 14 Apr 2018 10:13:14 +0000 (10:13 +0000)
Make sure that fractional values are not sent to masterPosWait()

Change-Id: I0a66471d4bf7005774b5741702c7f9c65bbfd5d0

includes/libs/rdbms/loadbalancer/LoadBalancer.php

index 94acc1e..96b6180 100644 (file)
@@ -591,7 +591,7 @@ class LoadBalancer implements ILoadBalancer {
         * @return bool
         */
        protected function doWait( $index, $open = false, $timeout = null ) {
-               $timeout = max( 1, $timeout ?: $this->waitTimeout );
+               $timeout = max( 1, intval( $timeout ?: $this->waitTimeout ) );
 
                // Check if we already know that the DB has reached this point
                $server = $this->getServerName( $index );