hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xu...@apache.org
Subject hive git commit: HIVE-16961: Hive on Spark leaks spark application in case user cancels query and closes session (reviewed by Rui)
Date Wed, 05 Jul 2017 17:33:33 GMT
Repository: hive
Updated Branches:
  refs/heads/master 26f1bdeb4 -> 0731dab18


HIVE-16961: Hive on Spark leaks spark application in case user cancels query and closes session
(reviewed by Rui)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/0731dab1
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/0731dab1
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/0731dab1

Branch: refs/heads/master
Commit: 0731dab18c85363d4bad8a556c437a587277143c
Parents: 26f1bde
Author: Xuefu Zhang <xuefu@uber.com>
Authored: Wed Jul 5 10:33:18 2017 -0700
Committer: Xuefu Zhang <xuefu@uber.com>
Committed: Wed Jul 5 10:33:18 2017 -0700

----------------------------------------------------------------------
 .../org/apache/hive/spark/client/SparkClientImpl.java    | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/0731dab1/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java
----------------------------------------------------------------------
diff --git a/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java
b/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java
index bf7e8db..03e773a 100644
--- a/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java
+++ b/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java
@@ -508,16 +508,19 @@ class SparkClientImpl implements SparkClient {
                 }
               }
 
-              rpcServer.cancelClient(clientId,
-                  "Child process exited before connecting back with error log " + errStr.toString());
               LOG.warn("Child process exited with code {}", exitCode);
+              rpcServer.cancelClient(clientId,
+                  "Child process (spark-submit) exited before connecting back with error
log " + errStr.toString());
             }
           } catch (InterruptedException ie) {
-            LOG.warn("Waiting thread interrupted, killing child process.");
+            LOG.warn("Thread waiting on the child process (spark-submit) is interrupted,
killing the child process.");
+            rpcServer.cancelClient(clientId, "Thread waiting on the child porcess (spark-submit)
is interrupted");
             Thread.interrupted();
             child.destroy();
           } catch (Exception e) {
-            LOG.warn("Exception while waiting for child process.", e);
+            String errMsg = "Exception while waiting for child process (spark-submit)";
+            LOG.warn(errMsg, e);
+            rpcServer.cancelClient(clientId, errMsg);
           }
         }
       };


Mime
View raw message