r98203 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98202‎ | r98203 | r98204 >
Date:00:50, 27 September 2011
Author:brion
Status:ok
Tags:
Comment:
MFT r98200: logging and possible fix for bug 31177: sidebar message load failures
Modified paths:
  • /branches/REL1_18/phase3/includes/cache/MessageCache.php (modified) (history)

Diff [purge]

Index: branches/REL1_18/phase3/includes/cache/MessageCache.php
@@ -401,7 +401,16 @@
402402 );
403403
404404 foreach ( $res as $row ) {
405 - $cache[$row->page_title] = ' ' . Revision::getRevisionText( $row );
 405+ $text = Revision::getRevisionText( $row );
 406+ if( $text === false ) {
 407+ // Failed to fetch data; possible ES errors?
 408+ // Store a marker to fetch on-demand as a workaround...
 409+ $entry = '!TOO BIG';
 410+ wfDebugLog( 'MessageCache', __METHOD__ . ": failed to load message page text for {$row->page_title} ($code)" );
 411+ } else {
 412+ $entry = ' ' . $text;
 413+ }
 414+ $cache[$row->page_title] = $entry;
406415 }
407416
408417 $cache['VERSION'] = MSG_CACHE_VERSION;
@@ -683,8 +692,13 @@
684693 $revision = Revision::newFromTitle( Title::makeTitle( NS_MEDIAWIKI, $title ) );
685694 if ( $revision ) {
686695 $message = $revision->getText();
687 - $this->mCache[$code][$title] = ' ' . $message;
688 - $this->mMemc->set( $titleKey, ' ' . $message, $this->mExpiry );
 696+ if ($message === false) {
 697+ // A possibly temporary loading failure.
 698+ wfDebugLog( 'MessageCache', __METHOD__ . ": failed to load message page text for {$title->getDbKey()} ($code)" );
 699+ } else {
 700+ $this->mCache[$code][$title] = ' ' . $message;
 701+ $this->mMemc->set( $titleKey, ' ' . $message, $this->mExpiry );
 702+ }
689703 } else {
690704 $this->mCache[$code][$title] = '!NONEXISTENT';
691705 $this->mMemc->set( $titleKey, '!NONEXISTENT', $this->mExpiry );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r98200Debug logging and possible fix for bug 31177: mystery sidebar message failures...brion00:41, 27 September 2011
r98201MFT r98200: logging and possible fix for bug 31177: sidebar message load fail...brion00:42, 27 September 2011

Status & tagging log