Ngone51 commented on a change in pull request #31053:
URL: https://github.com/apache/spark/pull/31053#discussion_r557264782



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/internal/SharedState.scala
##########
@@ -171,17 +171,19 @@ private[sql] class SharedState(
 
 object SharedState extends Logging {
   @volatile private var fsUrlStreamHandlerFactoryInitialized = false
-  private var sharedState: SharedState = _
+  @volatile private var _sharedState: SharedState = _
 
-  def getSharedState(
-      sparkContext: SparkContext,
-      initialConfigs: scala.collection.Map[String, String])
-    : SharedState = synchronized {
-    if (sharedState == null) {
-      // Ensure that we only initiate SharedState once
-      sharedState = new SharedState(sparkContext, initialConfigs)
+  def get(sparkContext: SparkContext, initialConfigs: 
scala.collection.Map[String, String])
+    : SharedState = {
+    if (_sharedState == null) {
+      synchronized {
+        if (_sharedState == null) {
+          // Ensure that we only initiate SharedState once

Review comment:
       removed. thanks!




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



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

Reply via email to