liuxunorg commented on a change in pull request #3342: [ZEPPELIN-4031] Fixed 
Unable to detect that the interpreter process was killed manually
URL: https://github.com/apache/zeppelin/pull/3342#discussion_r268967854
 
 

 ##########
 File path: 
zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/ManagedInterpreterGroup.java
 ##########
 @@ -141,17 +165,27 @@ private void close(Collection<Interpreter> interpreters) 
{
   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 ");
-    }
+    // Need to abort the task being executed
+    // when actively shutting down the remote interpreter
+    if (false == remoteIntpProcessIsShutdown()) {
 
 Review comment:
   ### 1. If interpreter process is normal, isRunning() must equal true
   `isRunning()` is not a flag, It's a function call.
   `interpreterProcess.isRunning()` Will call 
`RemoteInterpreterUtils.java::checkIfRemoteEndpointAccessible()` , Check if the 
remote interpreter is available through the socket.
   
   ### 2. Avoid invalid calls
   `Job.abort()` Will go to the remote to call the interpreter, 
`Interpreter.cancel(getInterpreterContext(null));` function. If the interpreter 
is no longer connected, The `interpreter.cancel()` function cannot be called 
correctly.
   
   But if you find that the remote interpreter is not available in 
`job.abort()`, Will pass again
   `RemoteInterpreter.java::getOrCreateInterpreterProcess()`, Trying to create 
an interpreter process, This will fail due to a 30 second timeout.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to