Merge "Avoid MapCacheLRU error when MessageCache fails to load"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 14 Aug 2018 16:32:07 +0000 (16:32 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 14 Aug 2018 16:32:07 +0000 (16:32 +0000)
1  2 
includes/cache/MessageCache.php

@@@ -232,13 -232,13 +232,13 @@@ class MessageCache 
         * (2) memcached
         * (3) from the database.
         *
 -       * When succesfully loading from (2) or (3), all higher level caches are
 +       * When successfully loading from (2) or (3), all higher level caches are
         * updated for the newest version.
         *
         * Nothing is loaded if member variable mDisable is true, either manually
         * set by calling code or if message loading fails (is this possible?).
         *
 -       * Returns true if cache is already populated or it was succesfully populated,
 +       * Returns true if cache is already populated or it was successfully populated,
         * or false if populating empty cache fails. Also returns true if MessageCache
         * is disabled.
         *
                if ( !$success ) {
                        $where[] = 'loading FAILED - cache is disabled';
                        $this->mDisable = true;
-                       $this->cache->set( $code, null );
+                       $this->cache->set( $code, [] );
                        wfDebugLog( 'MessageCacheError', __METHOD__ . ": Failed to load $code\n" );
                        # This used to throw an exception, but that led to nasty side effects like
                        # the whole wiki being instantly down if the memcached server died