r104059 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104058‎ | r104059 | r104060 >
Date:18:04, 23 November 2011
Author:catrope
Status:ok
Tags:
Comment:
1.18wmf1: Live hacks for investigating bug 31576: add server name to pcache comment, and log to a file whenever we encounter a parse result that has suspicious things such as PAGENAME or NAMESPACE in its templates list
Modified paths:
  • /branches/wmf/1.18wmf1/includes/parser/ParserCache.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/includes/parser/ParserCache.php
@@ -220,8 +220,18 @@
221221 // Save the timestamp so that we don't have to load the revision row on view
222222 $parserOutput->mTimestamp = $article->getTimestamp();
223223
224 - $parserOutput->mText .= "\n<!-- Saved in parser cache with key $parserOutputKey and timestamp $now -->\n";
 224+ // HACK put host name in the parser cache comment --Roan
 225+ $hostname = wfHostname();
 226+ $parserOutput->mText .= "\n<!-- Saved in parser cache with key $parserOutputKey and timestamp $now generated by $hostname -->\n";
225227 wfDebug( "Saved in parser cache with key $parserOutputKey and timestamp $now\n" );
 228+ // HACK 2: check for occurrences of bug 31576
 229+ $templates = $parserOutput->getTemplates();
 230+ if ( isset( $templates[NS_TEMPLATE] ) ) {
 231+ $badStuff = array_intersect( array( 'PAGENAME', 'FULLPAGENAME', 'NAMESPACE' ), array_keys( $templates[NS_TEMPLATE] ) );
 232+ if ( $badStuff !== array() ) {
 233+ wfErrorLog( "Bad templates " . implode( ', ', $badStuff ) . " in page [[{$article->getTitle()->getPrefixedText()}]] key $parserOutputKey and timestamp $now generated by $hostname\n", 'udp://10.0.5.8:8420/bug31576' );
 234+ }
 235+ }
226236
227237 // Save the parser output
228238 $this->mMemc->set( $parserOutputKey, $parserOutput, $expire );

Follow-up revisions

RevisionCommit summaryAuthorDate
r1047011.18wmf1: Another live debugging hack for bug 31576catrope16:57, 30 November 2011
r1047221.18wmf1: Another logging hack for bug 31576catrope19:26, 30 November 2011
r104732Add RefreshLinks class to the AutoLoader, I'll need it for my cleanup script ...catrope20:03, 30 November 2011
r104758Script for cleaning up the mess left behind by bug 31576. Still haven't figur...catrope21:49, 30 November 2011
r105964Temporary workaround for bug 31576. The logs show that once every hour or so,...tstarling01:14, 13 December 2011

Status & tagging log