You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by ta...@apache.org on 2021/10/28 13:24:44 UTC

[tika] branch main updated: small logic fix to get correct logging when ping fails (e.g. at startup).

This is an automated email from the ASF dual-hosted git repository.

tallison pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tika.git


The following commit(s) were added to refs/heads/main by this push:
     new 56c9aac  small logic fix to get correct logging when ping fails (e.g. at startup).
56c9aac is described below

commit 56c9aac4ec325826fb8fb626d411f95d94d7803f
Author: tballison <ta...@apache.org>
AuthorDate: Thu Oct 28 09:23:19 2021 -0400

    small logic fix to get correct logging when ping fails (e.g. at startup).
---
 .../src/main/java/org/apache/tika/pipes/PipesClient.java      | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tika-core/src/main/java/org/apache/tika/pipes/PipesClient.java b/tika-core/src/main/java/org/apache/tika/pipes/PipesClient.java
index 79dcc4f..7e1cf29 100644
--- a/tika-core/src/main/java/org/apache/tika/pipes/PipesClient.java
+++ b/tika-core/src/main/java/org/apache/tika/pipes/PipesClient.java
@@ -97,10 +97,15 @@ public class PipesClient implements Closeable {
     }
 
     public PipesResult process(FetchEmitTuple t) throws IOException, InterruptedException {
-
-        if (!ping() || (pipesConfig.getMaxFilesProcessedPerProcess() > 0 &&
-                filesProcessed >= pipesConfig.getMaxFilesProcessedPerProcess())) {
+        boolean restart = false;
+        if (!ping()) {
+            restart = true;
+        } else if (pipesConfig.getMaxFilesProcessedPerProcess() > 0 &&
+                filesProcessed >= pipesConfig.getMaxFilesProcessedPerProcess()) {
             LOG.info("restarting server after hitting max files: " + filesProcessed);
+            restart = true;
+        }
+        if (restart) {
             boolean successfulRestart = false;
             while (!successfulRestart) {
                 try {