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 2021/10/18 09:21:02 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #34292: [SPARK-37017][CORE] Reduce the scope of synchronized to prevent potential deadlock

cloud-fan commented on a change in pull request #34292:
URL: https://github.com/apache/spark/pull/34292#discussion_r730731340



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/connector/catalog/CatalogManager.scala
##########
@@ -89,12 +89,16 @@ class CatalogManager(
 
   private var _currentNamespace: Option[Array[String]] = None
 
-  def currentNamespace: Array[String] = synchronized {
-    _currentNamespace.getOrElse {
-      if (currentCatalog.name() == SESSION_CATALOG_NAME) {
-        Array(v1SessionCatalog.getCurrentDatabase)
-      } else {
-        currentCatalog.defaultNamespace()
+  def currentNamespace: Array[String] = {
+    val defaultName = if (currentCatalog.name() == SESSION_CATALOG_NAME) {

Review comment:
       `defaultNamespace`




-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org