Skip to content

[ZEPPELIN-4829] NPE in RemoteInterpreterServer#getStatus when interpreter is not opened yet#3776

Closed
zjffdu wants to merge 1 commit intoapache:masterfrom
zjffdu:ZEPPELIN-4829
Closed

[ZEPPELIN-4829] NPE in RemoteInterpreterServer#getStatus when interpreter is not opened yet#3776
zjffdu wants to merge 1 commit intoapache:masterfrom
zjffdu:ZEPPELIN-4829

Conversation

@zjffdu
Copy link
Contributor

@zjffdu zjffdu commented May 20, 2020

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?

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

Copy link
Contributor

@alexott alexott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Leemoonsoo
Copy link
Member

LGTM

Job job = intp.getScheduler().getJob(jobId);
if (job != null) {
return job.getStatus().name();
if (((LazyOpenInterpreter) intp).isOpen()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@zjffdu zjffdu force-pushed the ZEPPELIN-4829 branch 2 times, most recently from 381bd99 to 1203b7b Compare May 25, 2020 06:36
@asfgit asfgit closed this in 2608005 Jun 1, 2020
asfgit pushed a commit that referenced this pull request Jun 1, 2020
…eter is not opened yet

### 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

Author: Jeff Zhang <zjffdu@apache.org>

Closes #3776 from zjffdu/ZEPPELIN-4829 and squashes the following commits:

1203b7b [Jeff Zhang] [ZEPPELIN-4829]. NPE in RemoteInterpreterServer#getStatus when interpreter is not opened yet

(cherry picked from commit 2608005)
Signed-off-by: Jeff Zhang <zjffdu@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants