You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/06/05 18:55:18 UTC
[GitHub] [spark] rdblue commented on a change in pull request #24807:
[SPARK-27958] Stopping a SparkSession should not always stop Spark Context
rdblue commented on a change in pull request #24807: [SPARK-27958] Stopping a SparkSession should not always stop Spark Context
URL: https://github.com/apache/spark/pull/24807#discussion_r290886681
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala
##########
@@ -711,12 +711,16 @@ class SparkSession private(
// scalastyle:on
/**
- * Stop the underlying `SparkContext`.
+ * Stop the underlying `SparkContext` if there are are no active sessions remaining.
*
* @since 2.0.0
*/
def stop(): Unit = {
- sparkContext.stop()
+ if (SparkSession.numActiveSessions.get() == 0) {
Review comment:
Shouldn't this remove itself from the active sessions before checking that there are 0 remaining?
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org