r88904 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88903‎ | r88904 | r88905 >
Date:17:11, 26 May 2011
Author:btongminh
Status:reverted (Comments)
Tags:
Comment:
(bug 27891) Follow-up r72475: destroy the LBFactory singleton before doing any jobs so that jobs do not access the current session while still preserving ChronologyProtector.
Modified paths:
  • /trunk/phase3/includes/Wiki.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Wiki.php
@@ -321,8 +321,7 @@
322322 $this->context->output->output();
323323 // Do any deferred jobs
324324 wfDoUpdates( 'commit' );
325 - // Close the session so that jobs don't access the current session
326 - session_write_close();
 325+
327326 $this->doJobs();
328327 wfProfileOut( __METHOD__ );
329328 }
@@ -345,6 +344,10 @@
346345 } else {
347346 $n = intval( $wgJobRunRate );
348347 }
 348+
 349+ // Close the session so that jobs don't access the current session
 350+ $this->shutdownLBFactory();
 351+ session_write_close();
349352
350353 while ( $n-- && false != ( $job = Job::pop() ) ) {
351354 $output = $job->toString() . "\n";
@@ -367,11 +370,20 @@
368371 public function restInPeace() {
369372 MessageCache::logMessages();
370373 wfLogProfilingData();
 374+ $this->shutdownLBFactory();
 375+ wfDebug( "Request ended normally\n" );
 376+ }
 377+
 378+ /**
 379+ * Commit pending master changes, shutdown the current loadbalancer
 380+ * factory and destroys the factory instance.
 381+ */
 382+ private function shutdownLBFactory() {
371383 // Commit and close up!
372 - $factory = wfGetLBFactory();
 384+ $factory = LBFactory::singleton();
373385 $factory->commitMasterChanges();
374386 $factory->shutdown();
375 - wfDebug( "Request ended normally\n" );
 387+ LBFactory::destroyInstance();
376388 }
377389
378390 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r90293Per comments revert r88904 and remove session_write_close entirely. This will...btongminh16:42, 17 June 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r72475Follow-up r70137: Made asynchronous upload working a bit more. It now fully w...btongminh10:18, 6 September 2010
r83868Revert r79122, causes bug 27891 (old version seen immediately after edit).tstarling04:26, 14 March 2011
r83994Logging hack for bug 27891. Committing so I can revert it without being too sad.tstarling03:04, 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

Comments

#Comment by Tim Starling (talk | contribs)   04:53, 17 June 2011

Status & tagging log