r24535 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24534‎ | r24535 | r24536 >
Date:04:15, 2 August 2007
Author:brion
Status:old
Tags:
Comment:
Quick fix for dump problem:
Errors are ignored on a connection once it's died, so additional exceptions weren't getting thrown.
We weren't detecting this case and ended up spitting out the rest of the XML without any more text.
Should now die correctly once the timeouts finish.
Modified paths:
  • /trunk/phase3/maintenance/dumpTextPass.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/dumpTextPass.php
@@ -239,17 +239,23 @@
240240 }
241241 while( true ) {
242242 try {
243 - return $this->doGetText( $id );
 243+ $text = $this->doGetText( $id );
 244+ $ex = new MWException("Graceful storage failure");
244245 } catch (DBQueryError $ex) {
 246+ $text = false;
 247+ }
 248+ if( $text === false ) {
245249 $this->failures++;
246250 if( $this->failures > $this->maxFailures ) {
247251 throw $ex;
248252 } else {
249253 $this->progress( "Database failure $this->failures " .
250 - "of allowed $this->maxFailures! " .
 254+ "of allowed $this->maxFailures for revision $id! " .
251255 "Pausing $this->failureTimeout seconds..." );
252256 sleep( $this->failureTimeout );
253257 }
 258+ } else {
 259+ return $text;
254260 }
255261 }
256262 }
@@ -264,6 +270,9 @@
265271 array( 'old_id' => $id ),
266272 'TextPassDumper::getText' );
267273 $text = Revision::getRevisionText( $row );
 274+ if( $text === false ) {
 275+ return false;
 276+ }
268277 $stripped = str_replace( "\r", "", $text );
269278 $normalized = UtfNormal::cleanUp( $stripped );
270279 return $normalized;

Follow-up revisions

RevisionCommit summaryAuthorDate
r24631Merged revisions 24480-24600 via svnmerge from...david18:39, 6 August 2007

Status & tagging log