[ZEPPELIN-5981] Check binded interpreter inside Paragraph.jobAbort() #4693
+15
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is this PR for?
Inside an open zeppelin notebook, after running a paragraph by clicking the play icon button, canceling the running paragraph by clicking the pause icon button (or the Ctrl+Option+C shortcut) does not interrupt the running process and cancel the paragraph.
I've checked that
CANCEL_PARAGRAPH
message gets well passed through the websocket connection but server was somehow completely ignoring the message.After some more investigation, I've found that the reason for that was the
Paragraph
'sjobAbort()
method, which does nothing due to the null interpreter member.zeppelin/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java
Line 505 in 73e1aa3
I've checked some other methods of
Paragraph
such ascompletion()
,execute()
,jobRun()
,recover()
and they were initializing interpreter before doing something by callinggetBindedInterpreter()
, so I've changed thejobAbort()
method to do the same.zeppelin/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java
Line 258 in 73e1aa3
zeppelin/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java
Line 333 in 73e1aa3
zeppelin/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java
Line 399 in 73e1aa3
zeppelin/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java
Line 810 in 73e1aa3
Other than that, I have some doubts on whether it's right thing to return true on failing what was requested.
But after all, I just sticked to the original behavior (returning true for every case) to prevent some unexpected side effects.
What type of PR is it?
Bug Fix
Todos
N/A
What is the Jira issue?
How should this be tested?
for i in range(10): time.sleep(1)
Screenshots (if appropriate)
N/A
Questions: