You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by GitBox <gi...@apache.org> on 2021/10/08 09:53:50 UTC

[GitHub] [zeppelin] Reamer commented on a change in pull request #4116: [ZEPPELIN-5352] Support flink in k8s mode

Reamer commented on a change in pull request #4116:
URL: https://github.com/apache/zeppelin/pull/4116#discussion_r724869639



##########
File path: zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterServer.java
##########
@@ -701,8 +712,10 @@ public void run() {
       }
 
       if (server.isServing()) {
-        LOGGER.info("Force shutting down");
-        System.exit(1);
+        if (!isForceShutdown) {

Review comment:
       I think there is a typo here.

##########
File path: zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterServer.java
##########
@@ -142,6 +141,12 @@
   private ScheduledExecutorService resultCleanService = Executors.newSingleThreadScheduledExecutor();
 
   private boolean isTest;
+  // Whether calling System.exit to force shutdown interpreter process.
+  // In Flink K8s application mode, RemoteInterpreterServer#main is called via reflection by flink framework.
+  // We should not call System.exit in this scenario when RemoteInterpreterServer is stopped,
+  // Otherwise flink will think flink job is exited abnormally and will try to restart this
+  // pod (RemoteInterpreterServer)
+  private boolean isForceShutdown = false;

Review comment:
       Right now we have a forced shutdown, so we should change the default setting.

##########
File path: zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterServer.java
##########
@@ -380,11 +388,14 @@ public void createInterpreter(String interpreterGroupId, String sessionId, Strin
               replClass.getConstructor(new Class[]{Properties.class});
       Interpreter interpreter = constructor.newInstance(p);
       interpreter.setClassloaderUrls(new URL[]{});
-      LOGGER.info("Instantiate interpreter {}", className);
+
       interpreter.setInterpreterGroup(interpreterGroup);
       interpreter.setUserName(userName);
 
       interpreterGroup.addInterpreterToSession(new LazyOpenInterpreter(interpreter), sessionId);
+
+      this.isForceShutdown = Boolean.parseBoolean(properties.getOrDefault("zeppelin.interpreter.forceShutdown", "false"));

Review comment:
       Right now we have a forced shutdown, so we should change the default setting.

##########
File path: zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterServer.java
##########
@@ -321,7 +326,10 @@ public static void main(String[] args) throws Exception {
      * should be part of the next release and solve the problem.
      * We may have other threads that are not terminated successfully.
      */
-    System.exit(0);
+    if (!remoteInterpreterServer.isForceShutdown) {

Review comment:
       I think there is a typo here.
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org