No environment reset for failure after prefetch hit
authorChristian Aistleitner <christian@quelltextlich.at>
Mon, 23 Apr 2012 14:58:25 +0000 (16:58 +0200)
committerChristian Aistleitner <christian@quelltextlich.at>
Wed, 25 Apr 2012 10:12:19 +0000 (12:12 +0200)
Change-Id: I2377369c2f8c5a37db24ebf437a5ee7dd31d7bf6

maintenance/backupTextPass.inc

index acf4a10..11f0cd5 100644 (file)
@@ -487,20 +487,22 @@ class TextPassDumper extends BackupDumper {
                        // Something went wrong; we did not a text that was plausible :(
                        $failures++;
 
-
-                       // After backing off for some time, we try to reboot the whole process as
-                       // much as possible to not carry over failures from one part to the other
-                       // parts
-                       sleep( $this->failureTimeout );
-                       try {
-                               $this->rotateDb();
-                               if ( $this->spawn ) {
-                                       $this->closeSpawn();
-                                       $this->openSpawn();
+                       // A failure in a prefetch hit does not warrant resetting db connection etc.
+                       if ( ! $tryIsPrefetch ) {
+                               // After backing off for some time, we try to reboot the whole process as
+                               // much as possible to not carry over failures from one part to the other
+                               // parts
+                               sleep( $this->failureTimeout );
+                               try {
+                                       $this->rotateDb();
+                                       if ( $this->spawn ) {
+                                               $this->closeSpawn();
+                                               $this->openSpawn();
+                                       }
+                               } catch ( Exception $e ) {
+                                       $this->progress( "Rebooting getText infrastructure failed (" . $e->getMessage() . ")" .
+                                               " Trying to continue anyways" );
                                }
-                       } catch ( Exception $e ) {
-                               $this->progress( "Rebooting getText infrastructure failed (" . $e->getMessage() . ")" .
-                                       " Trying to continue anyways" );
                        }
                }