viirya commented on code in PR #53777:
URL: https://github.com/apache/spark/pull/53777#discussion_r2689573753


##########
sql/core/src/main/scala/org/apache/spark/sql/classic/SparkSession.scala:
##########
@@ -169,6 +175,13 @@ class SparkSession private(
    |  Session-related state  |
    * ----------------------- */
 
+  /**
+   * Track whether sessionState is currently being initialized. Used to 
prevent recursive calls
+   * to sessionState.conf during initialization (e.g., from SQLConf.get).
+   */
+  @transient
+  private var sessionStateInitializing: Boolean = false

Review Comment:
   If the active session's session state is not initialized, it will hit 
`session.sessionState.conf` to initiate the session state to get its configs.
   
   If the session state accesses SQLConf.get during initialization (previously 
the stack overflow case), as this flag is true now, it won't re-hit 
`session.sessionState.conf` again to trigger stack overflow.
   
   If the session state doesn't access SQLConf.get during initialization, it 
simply gets the configs of the session state.



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