hvanhovell commented on code in PR #52895:
URL: https://github.com/apache/spark/pull/52895#discussion_r2510580971
##########
sql/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectSessionManager.scala:
##########
@@ -332,14 +345,8 @@ class SparkConnectSessionManager extends Logging {
logDebug("Finished periodic run of SparkConnectSessionManager
maintenance.")
}
- private def newIsolatedSession(): SparkSession = {
- val active = SparkSession.active
- if (active.sparkContext.isStopped) {
- assert(SparkSession.getDefaultSession.nonEmpty)
- SparkSession.getDefaultSession.get.newSession()
- } else {
- active.newSession()
- }
+ private def newIsolatedSession(): SparkSession = synchronized {
Review Comment:
It is volatile. You can remove `synchronized`. My apologies for the
confusing.
--
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]