Add more log to queue server with regard to indexer or queue server crash, a=chris

Chris Pollett [2019-06-12 00:Jun:th]
Add more log to queue server with regard to indexer or queue server crash, a=chris
Filename
src/configs/Config.php
src/executables/QueueServer.php
diff --git a/src/configs/Config.php b/src/configs/Config.php
index 28c82ba35..802aef16d 100755
--- a/src/configs/Config.php
+++ b/src/configs/Config.php
@@ -361,11 +361,11 @@ nsdefine('WORK_DIRECTORY', DEFAULT_WORK_DIRECTORY);
 /** Directory for local versions of web app classes*/
 nsdefine('APP_DIR', WORK_DIRECTORY . "/app");
 /**
-   Directory to place files such as dictionaries that will be
-   converted to Bloom filter using token_tool.php. Similarly,
-   can be used to hold files which will be used to prepare
-   a file to assist in crawling or serving search results
-*/
+ * Directory to place files such as dictionaries that will be
+ * converted to Bloom filter using token_tool.php. Similarly,
+ * can be used to hold files which will be used to prepare
+ * a file to assist in crawling or serving search results
+ */
 nsdefine('PREP_DIR', WORK_DIRECTORY . "/prepare");
 /** Locale dir to use in case LOCALE_DIR does not exist yet or is
  * missing some file
diff --git a/src/executables/QueueServer.php b/src/executables/QueueServer.php
index f27057596..13e00d5e9 100755
--- a/src/executables/QueueServer.php
+++ b/src/executables/QueueServer.php
@@ -496,7 +496,9 @@ class QueueServer implements CrawlConstants, Join
             $last_check = $time;
         }
         if ($time - $last_check < C\LOG_TIMEOUT ||
-            $time - $first_check < C\PROCESS_TIMEOUT ) { return; }
+            $time - $first_check < C\PROCESS_TIMEOUT ) {
+            return;
+        }
         L\crawlLog("Checking if both processes still running ...");
         $lines_to_check = C\LOG_LINES_TO_RESTART;
             //about 20-30 minutes of log data
@@ -518,10 +520,17 @@ class QueueServer implements CrawlConstants, Join
         if (isset($process_lines[$num_lines - 1])) {
             $timestamp =
                 L\logLineTimestamp($process_lines[$num_lines - 1]);
+            L\crawlLog("...Timestamp of last processed line: ".
+                $timestamp);
             if ($timestamp > 1408934838) { //rules out false for timestamp
                 $last_process_timestamp = $timestamp;
+                L\crawlLog("...seems to be a valid timestep, so using.");
+            } else {
+                L\crawlLog("...invalid timestep, so using current time.");
             }
         }
+        L\crawlLog("...difference last timestamp and current time ".
+            ($time - $last_process_timestamp));
         if ($time - $last_process_timestamp < C\PROCESS_TIMEOUT ) {
             L\crawlLog("...done check. Both processes still running.");
             return;
ViewGit