zeppelin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mina...@apache.org
Subject zeppelin git commit: [ZEPPELIN-1196] Fix for bug ZEPPELIN-1196
Date Fri, 22 Jul 2016 06:57:23 GMT
Repository: zeppelin
Updated Branches:
  refs/heads/branch-0.6 1fcfe5dca -> 0b9efaacc


[ZEPPELIN-1196] Fix for bug ZEPPELIN-1196

### What is this PR for?
Fixed issue related to connecting to remote running interpreter process with multiple interpreters
in interpreter group throws illegal thread state exception

### What type of PR is it?
Bug Fix

### Todos

### What is the Jira issue?
[ZEPPELIN-1196] https://issues.apache.org/jira/browse/ZEPPELIN-1196

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Author: Sachin <sjanani@snappydata.io>

Closes #1197 from SachinJanani/branch-0.6 and squashes the following commits:

b3f2aa4 [Sachin] Removed unused variable and incorporated review comments
cf971ab [Sachin] Junit test for ZEPPELIN-1196
b922b8f [Sachin] [ZEPPELIN-1196] Fix for bug ZEPPELIN-1196


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

Branch: refs/heads/branch-0.6
Commit: 0b9efaacc062103267014e0e59669489c8ff48c6
Parents: 1fcfe5d
Author: Sachin <sjanani@snappydata.io>
Authored: Tue Jul 19 14:13:45 2016 +0530
Committer: Mina Lee <minalee@apache.org>
Committed: Fri Jul 22 15:57:15 2016 +0900

----------------------------------------------------------------------
 .../remote/RemoteInterpreterProcess.java        |  5 +++
 .../remote/RemoteInterpreterProcessTest.java    | 32 ++++++++++++++++++++
 2 files changed, 37 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0b9efaac/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterProcess.java
----------------------------------------------------------------------
diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterProcess.java
b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterProcess.java
index 05baf62..b4579bc 100644
--- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterProcess.java
+++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterProcess.java
@@ -113,6 +113,11 @@ public class RemoteInterpreterProcess implements ExecuteResultHandler
{
                   + "Please specify the port on which interpreter is listening");
             }
           }
+          executor = new DefaultExecutor();
+
+          watchdog = new ExecuteWatchdog(ExecuteWatchdog.INFINITE_TIMEOUT);
+          executor.setWatchdog(watchdog);
+
           running = true;
         }
 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0b9efaac/zeppelin-interpreter/src/test/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterProcessTest.java
----------------------------------------------------------------------
diff --git a/zeppelin-interpreter/src/test/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterProcessTest.java
b/zeppelin-interpreter/src/test/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterProcessTest.java
index f9d7d39..77571a9 100644
--- a/zeppelin-interpreter/src/test/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterProcessTest.java
+++ b/zeppelin-interpreter/src/test/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterProcessTest.java
@@ -103,4 +103,36 @@ public class RemoteInterpreterProcessTest {
     assertEquals(1, rip.reference(intpGroup));
     assertEquals(true, rip.isRunning());
   }
+  
+  
+  @Test
+  public void testRemoteInterpreterWithMultipleInterpreterInGroup() throws TException, InterruptedException
{
+    RemoteInterpreterServer server = new RemoteInterpreterServer(3679);
+    server.start();
+    long startTime = System.currentTimeMillis();
+    /*If RemoteInterpreterServer didn't start within 30 seconds than this test may fail
+     * which might be due to issue in RemoteInterpreterServer
+     */
+    while (System.currentTimeMillis() - startTime < 30 * 1000) {
+      if (server.isRunning()) {
+        break;
+      } else {
+        Thread.sleep(200);
+      }
+    }
+    Properties properties = new Properties();
+    properties.setProperty(Constants.ZEPPELIN_INTERPRETER_PORT, "3679");
+    properties.setProperty(Constants.ZEPPELIN_INTERPRETER_HOST, "localhost");
+    InterpreterGroup intpGroup = mock(InterpreterGroup.class);
+    when(intpGroup.getProperty()).thenReturn(properties);
+    when(intpGroup.containsKey(Constants.EXISTING_PROCESS)).thenReturn(true);
+    RemoteInterpreterProcess rip = new RemoteInterpreterProcess(INTERPRETER_SCRIPT, "nonexists",
+        "fakeRepo", new HashMap<String, String>(), 30 * 1000, null);
+    assertFalse(rip.isRunning());
+    assertEquals(0, rip.referenceCount());
+    assertEquals(1, rip.reference(intpGroup));
+    // Calling reference once again to depict multiple intrepreters in a group
+    assertEquals(2, rip.reference(intpGroup));
+    assertEquals(true, rip.isRunning());
+  }
 }


Mime
View raw message