[GitHub] [spark] HyukjinKwon commented on a change in pull request #32081: [SPARK-34674][CORE][K8S] Close SparkContext after the Main method has finished

2021-07-03 Thread GitBox


HyukjinKwon commented on a change in pull request #32081:
URL: https://github.com/apache/spark/pull/32081#discussion_r663434317



##
File path: core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala
##
@@ -952,6 +952,12 @@ private[spark] class SparkSubmit extends Logging {
 } catch {
   case t: Throwable =>
 throw findCause(t)
+} finally {
+  try {
+SparkContext.getActive.foreach(_.stop())

Review comment:
   cc @sunpe too FYI




-- 
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: reviews-unsubscr...@spark.apache.org

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



-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] [spark] HyukjinKwon commented on a change in pull request #32081: [SPARK-34674][CORE][K8S] Close SparkContext after the Main method has finished

2021-07-03 Thread GitBox


HyukjinKwon commented on a change in pull request #32081:
URL: https://github.com/apache/spark/pull/32081#discussion_r663434289



##
File path: core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala
##
@@ -952,6 +952,12 @@ private[spark] class SparkSubmit extends Logging {
 } catch {
   case t: Throwable =>
 throw findCause(t)
+} finally {
+  try {
+SparkContext.getActive.foreach(_.stop())

Review comment:
   Just reading this and https://github.com/apache/spark/pull/33154, 
shouldn't we enable this only w/ Kubernates (and also when it's not a 
Thirftserver, shall, etc.)?
   
   Also, I think we might have to add some comments on that.




-- 
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: reviews-unsubscr...@spark.apache.org

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



-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org