Treat message cache loading as fatal
authorNiklas Laxström <niklas.laxstrom@gmail.com>
Tue, 4 Dec 2012 12:35:01 +0000 (12:35 +0000)
committerNiklas Laxström <niklas.laxstrom@gmail.com>
Tue, 4 Dec 2012 12:35:01 +0000 (12:35 +0000)
I suspect this is the primary cause we occasionally have
* Sidebar stuck in default values
* No gadgets at all
* Main page full of <int:custom-message> occurances

Change-Id: I811755d4c250800177c4ea9e509bf6e1d13443a0

includes/cache/MessageCache.php

index 9bf7436..f5feaf9 100644 (file)
@@ -347,12 +347,12 @@ class MessageCache {
                }
 
                if ( !$success ) {
-                       # Bad luck... this should not happen
-                       $where[] = 'loading FAILED - cache is disabled';
-                       $info = implode( ', ', $where );
-                       wfDebug( __METHOD__ . ": Loading $code... $info\n" );
                        $this->mDisable = true;
                        $this->mCache = false;
+                       // This used to go on, but that led to lots of nasty side
+                       // effects like gadgets and sidebar getting cached with their
+                       // default content
+                       throw new MWException( "MessageCache failed to load messages" );
                } else {
                        # All good, just record the success
                        $info = implode( ', ', $where );