This is an automated email from the ASF dual-hosted git repository. zjffdu pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/zeppelin.git
The following commit(s) were added to refs/heads/master by this push: new 7d18dd7 [ZEPPELIN-5060] Disabled paragraph cause Zeppelin notebook to hang 7d18dd7 is described below commit 7d18dd7c020dabe8c3d3bd1603ea086f744416c4 Author: Timo Olkkonen <timo.p.olkko...@gmail.com> AuthorDate: Sat Oct 3 12:56:00 2020 +0300 [ZEPPELIN-5060] Disabled paragraph cause Zeppelin notebook to hang ### What is this PR for? When trying to run a disabled paragraph, backend hangs because the paragraph is not started, but we are still waiting for it to finish. Instead, we should skip it just like empty paragraphs. Also, we need to change paragraph state to pending, so next state change to finished is broadcasted to client. ### What type of PR is it? Bug Fix ### Todos ### What is the Jira issue? https://issues.apache.org/jira/browse/ZEPPELIN-5060 ### How should this be tested? ### Screenshots (if appropriate) ### Questions: Author: Timo Olkkonen <timo.p.olkko...@gmail.com> Closes #3932 from olkkoti/ZEPPELIN-5060 and squashes the following commits: 9de27f072 [Timo Olkkonen] Update integration test: disabled paragraph should be FINISHED after run all. 921e3dfdb [Timo Olkkonen] Set Paragraph status to Pending at start of execution, and skip if it is disabled. --- .../java/org/apache/zeppelin/integration/ParagraphActionsIT.java | 2 +- .../src/main/java/org/apache/zeppelin/notebook/Paragraph.java | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/zeppelin-integration/src/test/java/org/apache/zeppelin/integration/ParagraphActionsIT.java b/zeppelin-integration/src/test/java/org/apache/zeppelin/integration/ParagraphActionsIT.java index c6a11eb..a3e08b1 100644 --- a/zeppelin-integration/src/test/java/org/apache/zeppelin/integration/ParagraphActionsIT.java +++ b/zeppelin-integration/src/test/java/org/apache/zeppelin/integration/ParagraphActionsIT.java @@ -226,7 +226,7 @@ public class ParagraphActionsIT extends AbstractZeppelinIT { ZeppelinITUtils.sleep(2000, false); collector.checkThat("Paragraph status is ", - getParagraphStatus(1), CoreMatchers.equalTo("PENDING") + getParagraphStatus(1), CoreMatchers.equalTo("FINISHED") ); driver.navigate().refresh(); diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java index 689ecfd..1938298 100644 --- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java +++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java @@ -347,17 +347,24 @@ public class Paragraph extends JobWithProgressPoller<InterpreterResult> implemen = interpreterSetting.getConfig(interpreter.getClassName()); mergeConfig(config); + setStatus(Status.PENDING); + if (shouldSkipRunParagraph()) { LOGGER.info("Skip to run blank paragraph. {}", getId()); setStatus(Job.Status.FINISHED); return true; } - if (getConfig().get("enabled") == null || (Boolean) getConfig().get("enabled")) { + if (isEnabled()) { setAuthenticationInfo(getAuthenticationInfo()); interpreter.getScheduler().submit(this); + } else { + LOGGER.info("Skip disabled paragraph. {}", getId()); + setStatus(Job.Status.FINISHED); + return true; } + if (blocking) { while (!getStatus().isCompleted()) { try {