Quick fix for dump problem:
authorBrion Vibber <brion@users.mediawiki.org>
Thu, 2 Aug 2007 04:15:30 +0000 (04:15 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Thu, 2 Aug 2007 04:15:30 +0000 (04:15 +0000)
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.

maintenance/dumpTextPass.php

index a184094..92ab4b4 100644 (file)
@@ -239,17 +239,23 @@ class TextPassDumper extends BackupDumper {
                }
                while( true ) {
                        try {
-                               return $this->doGetText( $id );
+                               $text = $this->doGetText( $id );
+                               $ex = new MWException("Graceful storage failure");
                        } catch (DBQueryError $ex) {
+                               $text = false;
+                       }
+                       if( $text === false ) {
                                $this->failures++;
                                if( $this->failures > $this->maxFailures ) {
                                        throw $ex;
                                } else {
                                        $this->progress( "Database failure $this->failures " .
-                                               "of allowed $this->maxFailures! " .
+                                               "of allowed $this->maxFailures for revision $id! " .
                                                "Pausing $this->failureTimeout seconds..." );
                                        sleep( $this->failureTimeout );
                                }
+                       } else {
+                               return $text;
                        }
                }
        }
@@ -264,6 +270,9 @@ class TextPassDumper extends BackupDumper {
                        array( 'old_id' => $id ),
                        'TextPassDumper::getText' );
                $text = Revision::getRevisionText( $row );
+               if( $text === false ) {
+                       return false;
+               }
                $stripped = str_replace( "\r", "", $text );
                $normalized = UtfNormal::cleanUp( $stripped );
                return $normalized;