From 473b200a7d49ee25f2838cec84c6833b71d05fa2 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 10 Feb 2017 12:00:44 -0800 Subject: [PATCH] Type check the APC value in LoadBalancer::doWait() Change-Id: If00cd5fd2ace828ce03824ec7b5735de7d950dec --- includes/libs/rdbms/loadbalancer/LoadBalancer.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/libs/rdbms/loadbalancer/LoadBalancer.php b/includes/libs/rdbms/loadbalancer/LoadBalancer.php index 532a8edc396..900a79ca4d2 100644 --- a/includes/libs/rdbms/loadbalancer/LoadBalancer.php +++ b/includes/libs/rdbms/loadbalancer/LoadBalancer.php @@ -491,7 +491,10 @@ class LoadBalancer implements ILoadBalancer { $key = $this->srvCache->makeGlobalKey( __CLASS__, 'last-known-pos', $server ); /** @var DBMasterPos $knownReachedPos */ $knownReachedPos = $this->srvCache->get( $key ); - if ( $knownReachedPos && $knownReachedPos->hasReached( $this->mWaitForPos ) ) { + if ( + $knownReachedPos instanceof DBMasterPos && + $knownReachedPos->hasReached( $this->mWaitForPos ) + ) { $this->replLogger->debug( __METHOD__ . ": replica DB $server known to be caught up (pos >= $knownReachedPos)." ); return true; -- 2.11.4.GIT