hvanhovell commented on code in PR #52895:
URL: https://github.com/apache/spark/pull/52895#discussion_r2494667929


##########
sql/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectSessionManager.scala:
##########
@@ -333,13 +346,7 @@ class SparkConnectSessionManager extends Logging {
   }
 
   private def newIsolatedSession(): SparkSession = {
-    val active = SparkSession.active
-    if (active.sparkContext.isStopped) {
-      assert(SparkSession.getDefaultSession.nonEmpty)
-      SparkSession.getDefaultSession.get.newSession()
-    } else {
-      active.newSession()
-    }
+    baseSession.get.newSession()

Review Comment:
   This should be synchronized as well. You can also opt to make the variable 
volatile.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to