From 2c63d57ddd9b57817654c1b3c2d5c8019eb86c26 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 30 Sep 2015 13:39:54 -0700 Subject: [PATCH] Made User::loadFromId() skip cache with READ_LATEST * That flag is used for anti-dependencies and thus should never rely on cache Bug: T95839 Change-Id: I4ffc8325e55588ef649b96e7b90bc95282f765a9 --- includes/User.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/User.php b/includes/User.php index 4123eb2720..4822f537d3 100644 --- a/includes/User.php +++ b/includes/User.php @@ -385,10 +385,10 @@ class User implements IDBAccessObject { return false; } - // Try cache (unless this needs to lock the DB). + // Try cache (unless this needs data from the master DB). // NOTE: if this thread called saveSettings(), the cache was cleared. - $locking = ( ( $flags & self::READ_LOCKING ) == self::READ_LOCKING ); - if ( $locking || !$this->loadFromCache() ) { + $latest = DBAccessObjectUtils::hasFlags( $flags, self::READ_LATEST ); + if ( $latest || !$this->loadFromCache() ) { wfDebug( "User: cache miss for user {$this->mId}\n" ); // Load from DB (make sure this thread sees its own changes) if ( wfGetLB()->hasOrMadeRecentMasterChanges() ) { -- 2.20.1