r83994 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83993‎ | r83994 | r83995 >
Date:03:04, 15 March 2011
Author:tstarling
Status:reverted
Tags:
Comment:
Logging hack for bug 27891. Committing so I can revert it without being too sad.
Modified paths:
  • /branches/wmf/1.17wmf1/includes/parser/ParserCache.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/includes/parser/ParserCache.php
@@ -156,6 +156,30 @@
157157 wfIncrStats( "pcache_hit" );
158158 }
159159
 160+ // WMF logging hack for bug 27891 -- TS
 161+ if ( session_id() && substr( session_id(), 0, 1 ) === '0' ) {
 162+ $info = array(
 163+ 'title' => $article->getTitle()->getPrefixedDBkey(),
 164+ 'key' => $parserOutputKey,
 165+ 'mod-time' => $value->mTimestamp,
 166+ );
 167+ if ( isset( $_SESSION['wmfLastSaveInfo'] ) ) {
 168+ $lastInfo = $_SESSION['wmfLastSaveInfo'];
 169+ if ( $lastInfo['title'] == $info['title']
 170+ && $lastInfo['mod-time'] !== $info['mod-time']
 171+ && ( strpos( @$_SERVER['HTTP_REFERER'], 'action=submit' ) !== false ) )
 172+ {
 173+ wfDebugLog( 'bug-27891',
 174+ "User: " . $GLOBALS['wgUser']->getName() . ', ' .
 175+ "Session: " . session_id() . ', ' .
 176+ print_r( compact( 'lastInfo', 'info' ), true ) .
 177+ "\n" );
 178+ }
 179+ }
 180+ }
 181+ // End hack
 182+
 183+
160184 wfProfileOut( __METHOD__ );
161185 return $value;
162186 }
@@ -188,7 +212,35 @@
189213 $this->mMemc->set( $parserOutputKey, $parserOutput, $expire );
190214
191215 // ...and its pointer
192 - $this->mMemc->set( $this->getOptionsKey( $article ), $optionsKey, $expire );
 216+ $optionsKeyString = $this->getOptionsKey( $article );
 217+ $this->mMemc->set( $optionsKeyString, $optionsKey, $expire );
 218+
 219+ // WMF logging hack for bug 27891 -- TS
 220+ if ( session_id() && substr( session_id(), 0, 1 ) === '0' ) {
 221+ $info = array(
 222+ 'title' => $article->getTitle()->getPrefixedDBkey(),
 223+ 'key' => $parserOutputKey,
 224+ 'optionsKey' => $optionsKeyString,
 225+ 'now' => $now,
 226+ 'mod-time' => $parserOutput->mTimestamp,
 227+ );
 228+ if ( $GLOBALS['wgRequest']->getVal( 'action' ) == 'submit' ) {
 229+ $_SESSION['wmfLastSaveInfo'] = $info;
 230+ } elseif ( isset( $_SESSION['wmfLastSaveInfo'] ) ) {
 231+ $lastInfo = $_SESSION['wmfLastSaveInfo'];
 232+ if ( $lastInfo['title'] == $info['title']
 233+ && ( strpos( @$_SERVER['HTTP_REFERER'], 'action=submit' ) !== false ) )
 234+ {
 235+ wfDebugLog( 'bug-27891',
 236+ "User: " . $GLOBALS['wgUser']->getName() . ', ' .
 237+ "Session: " . session_id() . ', ' .
 238+ print_r( compact( 'lastInfo', 'info' ), true ) .
 239+ "\n" );
 240+ }
 241+ }
 242+ }
 243+ // End hack
 244+
193245 } else {
194246 wfDebug( "Parser output was marked as uncacheable and has not been saved.\n" );
195247 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r83995Revert r83994, no longer neededtstarling03:05, 15 March 2011
r87234Re-adding the logging hack from r83994 since bug 27891 has been reopenedtstarling01:57, 2 May 2011
r87235Remove the session_write_close() from r72475 since it apparently causes bug 2...tstarling04:21, 2 May 2011
r88904(bug 27891) Follow-up r72475: destroy the LBFactory singleton before doing an...btongminh17:11, 26 May 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r83868Revert r79122, causes bug 27891 (old version seen immediately after edit).tstarling04:26, 14 March 2011

Status & tagging log