From ccbf7efa563f8ab3bb505eca4032b7d045ef8c14 Mon Sep 17 00:00:00 2001 From: "Kwon, Yeong-Eon" Date: Tue, 14 Jun 2016 09:37:27 +0900 Subject: [PATCH 1/3] Prevent NullPointerException if "gatewayServer" does not exist --- .../java/org/apache/zeppelin/python/PythonInterpreter.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/src/main/java/org/apache/zeppelin/python/PythonInterpreter.java b/python/src/main/java/org/apache/zeppelin/python/PythonInterpreter.java index 23aeca24802..1bd3ca40a4b 100644 --- a/python/src/main/java/org/apache/zeppelin/python/PythonInterpreter.java +++ b/python/src/main/java/org/apache/zeppelin/python/PythonInterpreter.java @@ -125,8 +125,10 @@ public void close() { logger.info("closing Python interpreter ....."); try { - process.close(); - gatewayServer.shutdown(); + if (process != null) + process.close(); + if (gatewayServer != null) + gatewayServer.shutdown(); } catch (IOException e) { logger.error("Can't close the interpreter", e); } From 5ed2413dac8af9ee869ff5720f518fa80dc80f80 Mon Sep 17 00:00:00 2001 From: "Y.E. Kwon" Date: Wed, 15 Jun 2016 08:59:09 +0900 Subject: [PATCH 2/3] Fix code style --- .../java/org/apache/zeppelin/python/PythonInterpreter.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/src/main/java/org/apache/zeppelin/python/PythonInterpreter.java b/python/src/main/java/org/apache/zeppelin/python/PythonInterpreter.java index 1bd3ca40a4b..e80548f0eaf 100644 --- a/python/src/main/java/org/apache/zeppelin/python/PythonInterpreter.java +++ b/python/src/main/java/org/apache/zeppelin/python/PythonInterpreter.java @@ -125,10 +125,12 @@ public void close() { logger.info("closing Python interpreter ....."); try { - if (process != null) + if (process != null) { process.close(); - if (gatewayServer != null) + } + if (gatewayServer != null) { gatewayServer.shutdown(); + } } catch (IOException e) { logger.error("Can't close the interpreter", e); } From f697b645f7db958ef5a4188e8854b03c0a2b69a9 Mon Sep 17 00:00:00 2001 From: "Kwon, Yeong-Eon" Date: Sun, 12 Jun 2016 21:49:55 +0900 Subject: [PATCH 3/3] typo --- bin/zeppelin.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/zeppelin.sh b/bin/zeppelin.sh index 92d7f7ead96..701b8901c4b 100755 --- a/bin/zeppelin.sh +++ b/bin/zeppelin.sh @@ -83,7 +83,7 @@ if [[ ! -d "${ZEPPELIN_PID_DIR}" ]]; then fi if [[ ! -d "${ZEPPELIN_NOTEBOOK_DIR}" ]]; then - echo "Pid dir doesn't exist, create ${ZEPPELIN_NOTEBOOK_DIR}" + echo "Notebook dir doesn't exist, create ${ZEPPELIN_NOTEBOOK_DIR}" $(mkdir -p "${ZEPPELIN_NOTEBOOK_DIR}") fi