You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by GitBox <gi...@apache.org> on 2020/05/20 05:44:24 UTC

[GitHub] [zeppelin] zjffdu opened a new pull request #3776: [ZEPPELIN-4829] NPE in RemoteInterpreterServer#getStatus when interpreter is not opened yet

zjffdu opened a new pull request #3776:
URL: https://github.com/apache/zeppelin/pull/3776


   ### What is this PR for?
   
   The NPE happens because the scheduler of interpreter is null. This is because the interpreter is not opened yet. (https://github.com/apache/zeppelin/blob/v0.9.0-preview1/livy/src/main/java/org/apache/zeppelin/livy/LivySparkSQLInterpreter.java#L232)
   
   This PR would check wether interpreter is opened before using its scheduler.
   
   
   ### What type of PR is it?
   [Bug Fix ]
   
   ### Todos
   * [ ] - Task
   
   ### What is the Jira issue?
   * https://issues.apache.org/jira/browse/ZEPPELIN-4829
   
   ### How should this be tested?
   * CI pass
   
   ### Screenshots (if appropriate)
   
   ### Questions:
   * Does the licenses files need update? No
   * Is there breaking changes for older versions? No
   * Does this needs documentation? No
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zeppelin] Leemoonsoo commented on pull request #3776: [ZEPPELIN-4829] NPE in RemoteInterpreterServer#getStatus when interpreter is not opened yet

Posted by GitBox <gi...@apache.org>.
Leemoonsoo commented on pull request #3776:
URL: https://github.com/apache/zeppelin/pull/3776#issuecomment-632932439


   LGTM


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zeppelin] asfgit closed pull request #3776: [ZEPPELIN-4829] NPE in RemoteInterpreterServer#getStatus when interpreter is not opened yet

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #3776:
URL: https://github.com/apache/zeppelin/pull/3776


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zeppelin] zjffdu commented on a change in pull request #3776: [ZEPPELIN-4829] NPE in RemoteInterpreterServer#getStatus when interpreter is not opened yet

Posted by GitBox <gi...@apache.org>.
zjffdu commented on a change in pull request #3776:
URL: https://github.com/apache/zeppelin/pull/3776#discussion_r430126263



##########
File path: zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterServer.java
##########
@@ -904,9 +904,11 @@ public String getStatus(String sessionId, String jobId)
       }
 
       for (Interpreter intp : interpreters) {
-        Job job = intp.getScheduler().getJob(jobId);
-        if (job != null) {
-          return job.getStatus().name();
+        if (((LazyOpenInterpreter) intp).isOpen()) {

Review comment:
       @Reamer I use another approach which don't need class cast




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zeppelin] Reamer commented on a change in pull request #3776: [ZEPPELIN-4829] NPE in RemoteInterpreterServer#getStatus when interpreter is not opened yet

Posted by GitBox <gi...@apache.org>.
Reamer commented on a change in pull request #3776:
URL: https://github.com/apache/zeppelin/pull/3776#discussion_r429605716



##########
File path: zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterServer.java
##########
@@ -904,9 +904,11 @@ public String getStatus(String sessionId, String jobId)
       }
 
       for (Interpreter intp : interpreters) {
-        Job job = intp.getScheduler().getJob(jobId);
-        if (job != null) {
-          return job.getStatus().name();
+        if (((LazyOpenInterpreter) intp).isOpen()) {

Review comment:
       At the moment I can't view the whole source code. A `instanceof` should avoid a `ClassCastException`.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org