You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by jo...@apache.org on 2017/03/17 04:38:00 UTC
zeppelin git commit: [HOTFIX] Restart button raises exception in
interpreter side
Repository: zeppelin
Updated Branches:
refs/heads/master 36e5f6b08 -> dcee15afc
[HOTFIX] Restart button raises exception in interpreter side
### What is this PR for?
This PR is the following one of #2140. It prevent from raising exception in interpreter side while closing interpreter.
### What type of PR is it?
[Hot Fix]
### Todos
* [x] - Remove open() while close()
### What is the Jira issue?
N/A
### How should this be tested?
N/A
### Screenshots (if appropriate)
N/A
### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No
Author: Jongyoul Lee <jo...@gmail.com>
Closes #2147 from jongyoul/hotfix/restart-raise-exception and squashes the following commits:
12d6fa6 [Jongyoul Lee] Left comments
93b4c18 [Jongyoul Lee] Avoided opening interpreter while closing and calling close() in server side
Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/dcee15af
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/dcee15af
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/dcee15af
Branch: refs/heads/master
Commit: dcee15afc3e2907b11991217d61967f2dbb3dfdf
Parents: 36e5f6b
Author: Jongyoul Lee <jo...@gmail.com>
Authored: Fri Mar 17 11:08:36 2017 +0900
Committer: Jongyoul Lee <jo...@apache.org>
Committed: Fri Mar 17 13:37:53 2017 +0900
----------------------------------------------------------------------
.../apache/zeppelin/interpreter/LazyOpenInterpreter.java | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/zeppelin/blob/dcee15af/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/LazyOpenInterpreter.java
----------------------------------------------------------------------
diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/LazyOpenInterpreter.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/LazyOpenInterpreter.java
index ebecd10..0340632 100644
--- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/LazyOpenInterpreter.java
+++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/LazyOpenInterpreter.java
@@ -21,6 +21,7 @@ import java.net.URL;
import java.util.List;
import java.util.Properties;
+import org.apache.zeppelin.interpreter.remote.RemoteInterpreter;
import org.apache.zeppelin.interpreter.thrift.InterpreterCompletion;
import org.apache.zeppelin.scheduler.Scheduler;
@@ -74,10 +75,12 @@ public class LazyOpenInterpreter
@Override
public void close() {
- // To close interpreter, you should open it first.
- open();
- intp.close();
- opened = false;
+ // TODO(jl): Remove this trick!!
+ // intp.close() should be called to reduce referenceCount
+ if (isOpen() || intp instanceof RemoteInterpreter) {
+ intp.close();
+ opened = false;
+ }
}
public boolean isOpen() {