r85795 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85794‎ | r85795 | r85796 >
Date:16:20, 11 April 2011
Author:aaron
Status:reverted
Tags:
Comment:
Made purgeExpiredConfigurations use a separate session ala r85776
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedPageConfig.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedPageConfig.php
@@ -185,8 +185,10 @@
186186 */
187187 public static function purgeExpiredConfigurations() {
188188 if ( wfReadOnly() ) return;
189 -
190 - $dbw = wfGetDB( DB_MASTER );
 189+ # Get a separate master session for this transaction (deadlock avoidance)
 190+ $lb = wfGetLBFactory()->newMainLB();
 191+ $dbw = $lb->getConnection( DB_MASTER );
 192+ # Find pages with expired configs...
191193 $config = self::getDefaultVisibilitySettings(); // config is to be reset
192194 $encCutoff = $dbw->addQuotes( $dbw->timestamp() );
193195 $ret = $dbw->select(
@@ -196,6 +198,7 @@
197199 __METHOD__
198200 // array( 'FOR UPDATE' )
199201 );
 202+ # Figured out to do with each page...
200203 $pagesClearConfig = array();
201204 $pagesClearTracking = $titlesClearTracking = array();
202205 foreach ( $ret as $row ) {
@@ -232,5 +235,8 @@
233236 FlaggedRevs::HTMLCacheUpdates( $title ); // purge pages that use this page
234237 }
235238 }
 239+ # Commit this transaction and close session
 240+ $lb->commitMasterChanges();
 241+ $lb->closeAll();
236242 }
237243 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r87118Reverted r85795 since r85776 was brokenaaron06:14, 29 April 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r85776* (bug 28485) Block::purgeExpired Database returned error "1205: Lock wait ti...reedy00:29, 11 April 2011

Status & tagging log