Revert "Creating new WMF 1.20wmf2 branch"
[lhc/web/wiklou.git] / maintenance / backupTextPass.inc
index 6752166..11f0cd5 100644 (file)
@@ -444,6 +444,13 @@ class TextPassDumper extends BackupDumper {
                                        } else {
                                                $text = $this->getTextDb( $id );
                                        }
+
+                                       // No more checks for texts from DB for now.
+                                       // If we received something that is not false,
+                                       // We treat it as good text, regardless of whether it actually is or is not
+                                       if ( $text !== false ) {
+                                               return $text;
+                                       }
                                }
 
                                if ( $text === false ) {
@@ -480,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" );
                        }
                }