zeppelin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject zeppelin git commit: [ZEPPELIN-449] Enhance log messages when interpreter is initializing
Date Wed, 09 Nov 2016 06:32:34 GMT
Repository: zeppelin
Updated Branches:
  refs/heads/master e25266706 -> a4f9f6bad


[ZEPPELIN-449] Enhance log messages when interpreter is initializing

### What is this PR for?

Enhance log messages when interpreter is initializing to avoid user confusion.
### What type of PR is it?

[Bug Fix]
### What is the Jira issue?
- [ZEPPELIN-449](https://issues.apache.org/jira/browse/ZEPPELIN-449)

Author: Luciano Resende <lresende@apache.org>

Closes #1376 from lresende/zeppelin-449 and squashes the following commits:

1f75430 [Luciano Resende] [ZEPPELIN-449] Enhance log messages when intepreter is initializing


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/a4f9f6ba
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/a4f9f6ba
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/a4f9f6ba

Branch: refs/heads/master
Commit: a4f9f6bad83251d5a0b839b5e73bbe44f7468569
Parents: e252667
Author: Luciano Resende <lresende@apache.org>
Authored: Sun Aug 28 18:06:59 2016 -0700
Committer: Alexander Bezzubov <bzz@apache.org>
Committed: Wed Nov 9 15:32:23 2016 +0900

----------------------------------------------------------------------
 .../remote/RemoteInterpreterManagedProcess.java | 22 +++++++++++++-------
 .../remote/RemoteInterpreterUtils.java          | 15 +++++++++++--
 2 files changed, 27 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/a4f9f6ba/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterManagedProcess.java
----------------------------------------------------------------------
diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterManagedProcess.java
b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterManagedProcess.java
index eb34533..ddab105 100644
--- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterManagedProcess.java
+++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterManagedProcess.java
@@ -124,14 +124,20 @@ public class RemoteInterpreterManagedProcess extends RemoteInterpreterProcess
 
     long startTime = System.currentTimeMillis();
     while (System.currentTimeMillis() - startTime < getConnectTimeout()) {
-      if (RemoteInterpreterUtils.checkIfRemoteEndpointAccessible("localhost", port)) {
-        break;
-      } else {
-        try {
-          Thread.sleep(500);
-        } catch (InterruptedException e) {
-          logger.error("Exception in RemoteInterpreterProcess while synchronized reference
" +
-              "Thread.sleep", e);
+      try {
+        if (RemoteInterpreterUtils.checkIfRemoteEndpointAccessible("localhost", port)) {
+          break;
+        } else {
+          try {
+            Thread.sleep(500);
+          } catch (InterruptedException e) {
+            logger.error("Exception in RemoteInterpreterProcess while synchronized reference
" +
+                    "Thread.sleep", e);
+          }
+        }
+      } catch (Exception e) {
+        if (logger.isDebugEnabled()) {
+          logger.debug("Remote interpreter not yet accessible at localhost:" + port);
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/a4f9f6ba/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterUtils.java
----------------------------------------------------------------------
diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterUtils.java
b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterUtils.java
index a66b52a..2937e2d 100644
--- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterUtils.java
+++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterUtils.java
@@ -21,6 +21,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.io.IOException;
+import java.net.ConnectException;
 import java.net.InetSocketAddress;
 import java.net.ServerSocket;
 import java.net.Socket;
@@ -46,9 +47,19 @@ public class RemoteInterpreterUtils {
       discover.connect(new InetSocketAddress(host, port), 1000);
       discover.close();
       return true;
-    } catch (IOException e) {
+    } catch (ConnectException cne) {
       // end point is not accessible
-      LOGGER.debug(e.getMessage(), e);
+      if (LOGGER.isDebugEnabled()) {
+        LOGGER.debug("Remote endpoint '" + host + ":" + port + "' is not accessible " +
+                "(might be initializing): " + cne.getMessage());
+      }
+      return false;
+    } catch (IOException ioe) {
+      // end point is not accessible
+      if (LOGGER.isDebugEnabled()) {
+        LOGGER.debug("Remote endpoint '" + host + ":" + port + "' is not accessible " +
+                "(might be initializing): " + ioe.getMessage());
+      }
       return false;
     }
   }


Mime
View raw message