You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by zj...@apache.org on 2020/03/03 03:46:41 UTC

[zeppelin] branch master updated: [ZEPPELIN-4650]. Allow to keep job running while close interpreter

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 17e3eb9  [ZEPPELIN-4650]. Allow to keep job running while close interpreter
17e3eb9 is described below

commit 17e3eb9e39868f2e482ee0642329db0475e1ec9a
Author: Jeff Zhang <zj...@apache.org>
AuthorDate: Thu Feb 27 16:54:44 2020 +0800

    [ZEPPELIN-4650]. Allow to keep job running while close interpreter
    
    ### What is this PR for?
    
    This PR is to allow keeping job running while close interpreter. This is pretty useful for streaming jobs that you would like to keep it running even after the the interpreter is closed. Such as flink/spark streaming job. This PR introduce property `zeppelin.interpreter.close.cancel_job` to control that, each interpreter can configure it in its interpreter properties.
    
    ### What type of PR is it?
    [ Feature ]
    
    ### Todos
    * [ ] - Task
    
    ### What is the Jira issue?
    * https://jira.apache.org/jira/browse/ZEPPELIN-4650
    
    ### 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 <zj...@apache.org>
    
    Closes #3669 from zjffdu/ZEPPELIN-4650 and squashes the following commits:
    
    f64e01c18 [Jeff Zhang] [ZEPPELIN-4650]. Allow to keep job running while close interpreter
---
 .../zeppelin/interpreter/ManagedInterpreterGroup.java       | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/ManagedInterpreterGroup.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/ManagedInterpreterGroup.java
index 9454988..b387475 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/ManagedInterpreterGroup.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/ManagedInterpreterGroup.java
@@ -141,10 +141,15 @@ public class ManagedInterpreterGroup extends InterpreterGroup {
   private void closeInterpreter(Interpreter interpreter) {
     Scheduler scheduler = interpreter.getScheduler();
 
-    for (final Job job : scheduler.getAllJobs()) {
-      job.abort();
-      job.setStatus(Job.Status.ABORT);
-      LOGGER.info("Job " + job.getJobName() + " aborted ");
+    if (Boolean.parseBoolean(
+            interpreter.getProperty("zeppelin.interpreter.close.cancel_job", "true"))) {
+      for (final Job job : scheduler.getAllJobs()) {
+        job.abort();
+        job.setStatus(Job.Status.ABORT);
+        LOGGER.info("Job " + job.getJobName() + " aborted ");
+      }
+    } else {
+      LOGGER.info("Keep job running while closing interpreter: " + interpreter.getClassName());
     }
 
     try {