Skip to content
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

Closed
wants to merge 4 commits into from

Conversation

Savalek
Copy link
Contributor

@Savalek Savalek commented Jan 11, 2019

What is this PR for?

This PR add opportunity to stop notebook execution.

PR type: Improvement

Jira issue: ZEPPELIN-3943

stoprunall

Questions:

  • Does the licenses files need update? no
  • Is there breaking changes for older versions? no
  • Does this needs documentation? no

tooltip-placement="bottom"
uib-tooltip="Stop execution"
ng-disabled="revisionView">
<i class="icon-control-pause"></i>
Copy link
Member

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?

Copy link
Contributor Author

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);
Copy link
Member

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?

Copy link
Contributor Author

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();
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@felixcheung, i fixed it.

@Savalek Savalek force-pushed the ZP-54 branch 2 times, most recently from f93e305 to 49f4dfa Compare January 16, 2019 08:21
@@ -86,6 +86,7 @@

/********************************** transient fields ******************************************/
private transient boolean loaded = false;
private transient boolean executionAborted = false;
Copy link
Contributor

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.

Copy link
Contributor Author

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;
Copy link
Contributor

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

Copy link
Contributor Author

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.

@zjffdu
Copy link
Contributor

zjffdu commented Jan 23, 2019

Thanks @Savalek LGTM

@Savalek Savalek closed this Feb 4, 2019
@Savalek Savalek deleted the ZP-54 branch February 4, 2019 10:47
@Savalek Savalek restored the ZP-54 branch February 9, 2019 18:05
@Savalek Savalek reopened this Feb 9, 2019
@Savalek Savalek closed this Apr 15, 2019
@Savalek Savalek deleted the ZP-54 branch April 15, 2019 13:23
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