Index: trunk/phase3/maintenance/dumpTextPass.php |
— | — | @@ -239,17 +239,23 @@ |
240 | 240 | } |
241 | 241 | while( true ) { |
242 | 242 | try { |
243 | | - return $this->doGetText( $id ); |
| 243 | + $text = $this->doGetText( $id ); |
| 244 | + $ex = new MWException("Graceful storage failure"); |
244 | 245 | } catch (DBQueryError $ex) { |
| 246 | + $text = false; |
| 247 | + } |
| 248 | + if( $text === false ) { |
245 | 249 | $this->failures++; |
246 | 250 | if( $this->failures > $this->maxFailures ) { |
247 | 251 | throw $ex; |
248 | 252 | } else { |
249 | 253 | $this->progress( "Database failure $this->failures " . |
250 | | - "of allowed $this->maxFailures! " . |
| 254 | + "of allowed $this->maxFailures for revision $id! " . |
251 | 255 | "Pausing $this->failureTimeout seconds..." ); |
252 | 256 | sleep( $this->failureTimeout ); |
253 | 257 | } |
| 258 | + } else { |
| 259 | + return $text; |
254 | 260 | } |
255 | 261 | } |
256 | 262 | } |
— | — | @@ -264,6 +270,9 @@ |
265 | 271 | array( 'old_id' => $id ), |
266 | 272 | 'TextPassDumper::getText' ); |
267 | 273 | $text = Revision::getRevisionText( $row ); |
| 274 | + if( $text === false ) { |
| 275 | + return false; |
| 276 | + } |
268 | 277 | $stripped = str_replace( "\r", "", $text ); |
269 | 278 | $normalized = UtfNormal::cleanUp( $stripped ); |
270 | 279 | return $normalized; |