This is an automated email from the ASF dual-hosted git repository.

zjffdu pushed a commit to branch branch-0.8
in repository https://gitbox.apache.org/repos/asf/zeppelin.git


The following commit(s) were added to refs/heads/branch-0.8 by this push:
     new d3957f0  [ZEPPELIN-4042]. IPythonClient is not shutdown properly
d3957f0 is described below

commit d3957f011450a6f90a72d7dda640b2c6c2546d01
Author: Jeff Zhang <zjf...@apache.org>
AuthorDate: Fri Mar 8 11:24:07 2019 +0800

    [ZEPPELIN-4042]. IPythonClient is not shutdown properly
    
    ### What is this PR for?
    Trivial PR to fix the IPythonClient not shutdown issue. Otherwise user will 
get the following error
    ```
    Channel ManagedChannelImpl{logId=6, target=127.0.0.1:43464} was not 
shutdown properly!!! ~*~*~*
        Make sure to call shutdown()/shutdownNow() and wait until 
awaitTermination() returns true.
    java.lang.RuntimeException: ManagedChannel allocation site
        at 
io.grpc.internal.ManagedChannelOrphanWrapper$ManagedChannelReference.<init>(ManagedChannelOrphanWrapper.java:103)
        at 
io.grpc.internal.ManagedChannelOrphanWrapper.<init>(ManagedChannelOrphanWrapper.java:53)
        at 
io.grpc.internal.ManagedChannelOrphanWrapper.<init>(ManagedChannelOrphanWrapper.java:44)
        at 
io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:410)
    ...
    ```
    
    ### What type of PR is it?
    [Bug Fix ]
    
    ### Todos
    * [ ] - Task
    
    ### What is the Jira issue?
    * https://issues.apache.org/jira/browse/ZEPPELIN-4042
    
    ### 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 <zjf...@apache.org>
    
    Closes #3324 from zjffdu/ZEPPELIN-4042 and squashes the following commits:
    
    72e1ceb58 [Jeff Zhang] [ZEPPELIN-4042]. IPythonClient is not shutdown 
properly
    
    (cherry picked from commit 1652d6898eb5d4b2671a5c21f4f4dab52614ed9b)
    Signed-off-by: Jeff Zhang <zjf...@apache.org>
---
 .../src/main/java/org/apache/zeppelin/python/IPythonInterpreter.java | 5 +++++
 1 file changed, 5 insertions(+)

diff --git 
a/python/src/main/java/org/apache/zeppelin/python/IPythonInterpreter.java 
b/python/src/main/java/org/apache/zeppelin/python/IPythonInterpreter.java
index c775574..392ad3b 100644
--- a/python/src/main/java/org/apache/zeppelin/python/IPythonInterpreter.java
+++ b/python/src/main/java/org/apache/zeppelin/python/IPythonInterpreter.java
@@ -326,6 +326,11 @@ public class IPythonInterpreter extends Interpreter 
implements ExecuteResultHand
     if (watchDog != null) {
       LOGGER.debug("Kill IPython Process");
       ipythonClient.stop(StopRequest.newBuilder().build());
+      try {
+        ipythonClient.shutdown();
+      } catch (InterruptedException e) {
+        LOGGER.warn("Fail to shutdown IPythonClient");
+      }
       watchDog.destroyProcess();
       gatewayServer.shutdown();
     }

Reply via email to