You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ne...@apache.org on 2019/06/04 16:04:35 UTC

[incubator-pinot] branch master updated: Avoid negative sleep time in startupServiceStatusCheck (#4276)

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

nehapawar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 3ecdc5c  Avoid negative sleep time in startupServiceStatusCheck (#4276)
3ecdc5c is described below

commit 3ecdc5cd1eeedac643f160f52a540b3bc5bb308e
Author: Neha Pawar <np...@linkedin.com>
AuthorDate: Tue Jun 4 09:04:29 2019 -0700

    Avoid negative sleep time in startupServiceStatusCheck (#4276)
---
 .../pinot/server/starter/helix/HelixServerStarter.java  | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/pinot-server/src/main/java/org/apache/pinot/server/starter/helix/HelixServerStarter.java b/pinot-server/src/main/java/org/apache/pinot/server/starter/helix/HelixServerStarter.java
index 4e8c20f..f3389bd 100644
--- a/pinot-server/src/main/java/org/apache/pinot/server/starter/helix/HelixServerStarter.java
+++ b/pinot-server/src/main/java/org/apache/pinot/server/starter/helix/HelixServerStarter.java
@@ -342,14 +342,15 @@ public class HelixServerStarter {
         throw new IllegalStateException("Service status is BAD");
       }
       long sleepTimeMs = Math.min(checkIntervalMs, endTimeMs - currentTimeMs);
-      LOGGER.info("Sleep for {}ms as service status has not turned GOOD: {}", sleepTimeMs,
-          ServiceStatus.getStatusDescription());
-      try {
-        Thread.sleep(sleepTimeMs);
-      } catch (InterruptedException e) {
-        LOGGER.warn("Got interrupted while checking service status", e);
-        Thread.currentThread().interrupt();
-        break;
+      if (sleepTimeMs > 0) {
+        LOGGER.info("Sleep for {}ms as service status has not turned GOOD: {}", sleepTimeMs, ServiceStatus.getStatusDescription());
+        try {
+          Thread.sleep(sleepTimeMs);
+        } catch (InterruptedException e) {
+          LOGGER.warn("Got interrupted while checking service status", e);
+          Thread.currentThread().interrupt();
+          break;
+        }
       }
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org