diff options
author | linweizhong <linweizhong@huawei.com> | 2015-09-17 22:25:24 -0700 |
---|---|---|
committer | Yin Huai <yhuai@databricks.com> | 2015-09-17 22:25:24 -0700 |
commit | 93c7650ab60a839a9cbe8b4ea1d5eda93e53ebe0 (patch) | |
tree | 28526e76b146b64e848f590f3c6f3d848a332e9d /sql | |
parent | d009da2f5c803f3b7344c96abbfcf3ecef2f5ad2 (diff) | |
download | spark-93c7650ab60a839a9cbe8b4ea1d5eda93e53ebe0.tar.gz spark-93c7650ab60a839a9cbe8b4ea1d5eda93e53ebe0.tar.bz2 spark-93c7650ab60a839a9cbe8b4ea1d5eda93e53ebe0.zip |
[SPARK-9522] [SQL] SparkSubmit process can not exit if kill application when HiveThriftServer was starting
When we start HiveThriftServer, we will start SparkContext first, then start HiveServer2, if we kill application while HiveServer2 is starting then SparkContext will stop successfully, but SparkSubmit process can not exit.
Author: linweizhong <linweizhong@huawei.com>
Closes #7853 from Sephiroth-Lin/SPARK-9522.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2.scala | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2.scala index dd9fef9206..a0643cec0f 100644 --- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2.scala +++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2.scala @@ -93,6 +93,12 @@ object HiveThriftServer2 extends Logging { } else { None } + // If application was killed before HiveThriftServer2 start successfully then SparkSubmit + // process can not exit, so check whether if SparkContext was stopped. + if (SparkSQLEnv.sparkContext.stopped.get()) { + logError("SparkContext has stopped even if HiveServer2 has started, so exit") + System.exit(-1) + } } catch { case e: Exception => logError("Error starting HiveThriftServer2", e) |