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 2020/03/03 13:55:14 UTC

[GitHub] [spark] HyukjinKwon commented on a change in pull request #24807: [SPARK-27958][SQL] Stopping a SparkSession should not always stop Spark Context

HyukjinKwon commented on a change in pull request #24807: [SPARK-27958][SQL] Stopping a SparkSession should not always stop Spark Context
URL: https://github.com/apache/spark/pull/24807#discussion_r387033359
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala
 ##########
 @@ -981,17 +988,26 @@ object SparkSession extends Logging {
    * @since 2.0.0
    */
   def setActiveSession(session: SparkSession): Unit = {
-    activeThreadSession.set(session)
+    if (session != getActiveSession.get && getActiveSession.isDefined) {
+      numActiveSessions.getAndIncrement
 
 Review comment:
   Another problem is that the current behaviour is clearly documented. It doesn't look particularly wrong either:
   
   > Stop the underlying `SparkContext`
   
   We're trying to make a behaviour change just based on the new design choice.
   Shell we at least keep the compatibility via a switch?

----------------------------------------------------------------
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