-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ZEPPELIN-3943] - Add button "stop notebook execution" #3281
Conversation
tooltip-placement="bottom" | ||
uib-tooltip="Stop execution" | ||
ng-disabled="revisionView"> | ||
<i class="icon-control-pause"></i> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's a pause icon - is there a stop icon?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simple-line-icons.css not contains 'stop' button. Therefore, I used 'icon-control-pause'.
In paragraph-control.html 'icon-control-pause' is also used to stop a paragraph.
} | ||
} catch (IOException e) { | ||
LOGGER.error("Can't run paragraph", e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this get reported to the user in the frontend?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think not worth it. Since if something goes wrong during the start of a paragraph, then an error message will be displayed in the paragraph.
|
||
for (Paragraph paragraph : note.getParagraphs()) { | ||
if (paragraph.isRunning()) { | ||
paragraph.abort(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a race condition? since runParagraph
is a loop, what if we abort para 1 but there threadpool thread runs para 2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@felixcheung, i fixed it.
f93e305
to
49f4dfa
Compare
@@ -86,6 +86,7 @@ | |||
|
|||
/********************************** transient fields ******************************************/ | |||
private transient boolean loaded = false; | |||
private transient boolean executionAborted = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, it's non-volatile object. It doesnt looks like thread safe code.
You should use volatile w synchronized or something like java.util.concurrent.atomic.AtomicBoolean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i fixed it
if (note.isExecutionAborted() || !runParagraph(noteId, paragraphId, title, text, | ||
params, config, false, true, context, callback)) { | ||
// stop execution when one paragraph fails. | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is duplicated with Note#runAll
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zjffdu, i did a little refactoring. And left only one method to run several paragraphs.
Thanks @Savalek LGTM |
What is this PR for?
This PR add opportunity to stop notebook execution.
PR type:
Improvement
Jira issue:
ZEPPELIN-3943
Questions: