You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by mi...@apache.org on 2017/01/24 01:00:38 UTC

zeppelin git commit: HOTFIX: Add the missing quotation for livy cancel

Repository: zeppelin
Updated Branches:
  refs/heads/master 7b7625db1 -> 68e0b3813


HOTFIX: Add the missing quotation for livy cancel

### What is this PR for?
Seems I miss the quote when rebase. This cause the session recreation fails, I correct it in this PR.

### What type of PR is it?
[Hot Fix |]

### Todos
* [ ] - Task

### What is the Jira issue?
No jira created, just minor change for hotfix

### How should this be tested?
Tested manually

### Screenshots (if appropriate)
![image](https://cloud.githubusercontent.com/assets/164491/22193778/b8f960dc-e178-11e6-8595-b21f01ac62f9.png)

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

Author: Jeff Zhang <zj...@apache.org>

Closes #1933 from zjffdu/cancel_livy and squashes the following commits:

d68b6cf [Jeff Zhang] HOTFIX: Add the missing quotes for livy cancel


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

Branch: refs/heads/master
Commit: 68e0b3813f77b3004859eda21506da90ac600fa3
Parents: 7b7625d
Author: Jeff Zhang <zj...@apache.org>
Authored: Mon Jan 23 14:30:44 2017 +0800
Committer: Mina Lee <mi...@apache.org>
Committed: Tue Jan 24 10:00:31 2017 +0900

----------------------------------------------------------------------
 .../apache/zeppelin/livy/BaseLivyInterprereter.java | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/68e0b381/livy/src/main/java/org/apache/zeppelin/livy/BaseLivyInterprereter.java
----------------------------------------------------------------------
diff --git a/livy/src/main/java/org/apache/zeppelin/livy/BaseLivyInterprereter.java b/livy/src/main/java/org/apache/zeppelin/livy/BaseLivyInterprereter.java
index 56b068d..6b72906 100644
--- a/livy/src/main/java/org/apache/zeppelin/livy/BaseLivyInterprereter.java
+++ b/livy/src/main/java/org/apache/zeppelin/livy/BaseLivyInterprereter.java
@@ -212,13 +212,6 @@ public abstract class BaseLivyInterprereter extends Interpreter {
       long start = System.currentTimeMillis();
       // pull the session status until it is idle or timeout
       while (!sessionInfo.isReady()) {
-        LOGGER.info("Session {} is in state {}, appId {}", sessionInfo.id, sessionInfo.state,
-            sessionInfo.appId);
-        if (sessionInfo.isFinished()) {
-          String msg = "Session " + sessionInfo.id + " is finished, appId: " + sessionInfo.appId
-              + ", log: " + sessionInfo.log;
-          throw new LivyException(msg);
-        }
         if ((System.currentTimeMillis() - start) / 1000 > sessionCreationTimeout) {
           String msg = "The creation of session " + sessionInfo.id + " is timeout within "
               + sessionCreationTimeout + " seconds, appId: " + sessionInfo.appId
@@ -227,6 +220,13 @@ public abstract class BaseLivyInterprereter extends Interpreter {
         }
         Thread.sleep(pullStatusInterval);
         sessionInfo = getSessionInfo(sessionInfo.id);
+        LOGGER.info("Session {} is in state {}, appId {}", sessionInfo.id, sessionInfo.state,
+            sessionInfo.appId);
+        if (sessionInfo.isFinished()) {
+          String msg = "Session " + sessionInfo.id + " is finished, appId: " + sessionInfo.appId
+              + ", log: " + sessionInfo.log;
+          throw new LivyException(msg);
+        }
       }
       return sessionInfo;
     } catch (Exception e) {
@@ -438,7 +438,7 @@ public abstract class BaseLivyInterprereter extends Interpreter {
         || response.getStatusCode().value() == 201) {
       return response.getBody();
     } else if (response.getStatusCode().value() == 404) {
-      if (response.getBody().matches("Session '\\d+' not found.")) {
+      if (response.getBody().matches("\"Session '\\d+' not found.\"")) {
         throw new SessionNotFoundException(response.getBody());
       } else {
         throw new APINotFoundException("No rest api found for " + targetURL +