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 2018/12/22 19:36:23 UTC

[GitHub] gatorsmile closed pull request #19605: [SPARK-22394] [SQL] Remove redundant synchronization for metastore access

gatorsmile closed pull request #19605: [SPARK-22394] [SQL] Remove redundant synchronization for metastore access
URL: https://github.com/apache/spark/pull/19605
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala
index 96dc983b0bfc6..4a99a59413ea0 100644
--- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala
+++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala
@@ -89,10 +89,12 @@ private[spark] class HiveExternalCatalog(conf: SparkConf, hadoopConf: Configurat
   }
 
   /**
-   * Run some code involving `client` in a [[synchronized]] block and wrap certain
-   * exceptions thrown in the process in [[AnalysisException]].
+   * Run some code involving `client` and wrap certain exceptions thrown in the process in
+   * [[AnalysisException]]. Thread-safety is guaranteed here because methods in the `client`
+   * ([[org.apache.spark.sql.hive.client.HiveClientImpl]]) are already synchronized through
+   * `clientLoader` in the `retryLocked` method.
    */
-  private def withClient[T](body: => T): T = synchronized {
+  private def withClient[T](body: => T): T = {
     try {
       body
     } catch {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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