Repository: spark
Updated Branches:
  refs/heads/master 796e48c60 -> 67ea11ea0


[SPARK-22891][SQL] Make hive client creation thread safe

## What changes were proposed in this pull request?

This is to walk around the hive issue: 
https://issues.apache.org/jira/browse/HIVE-11935

## How was this patch tested?

(Please explain how this patch was tested. E.g. unit tests, integration tests, 
manual tests)
(If this patch involves UI changes, please attach a screenshot; otherwise, 
remove this)

Please review http://spark.apache.org/contributing.html before opening a pull 
request.

Author: Feng Liu <feng...@databricks.com>

Closes #20109 from liufengdb/synchronized.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/67ea11ea
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/67ea11ea
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/67ea11ea

Branch: refs/heads/master
Commit: 67ea11ea0fd83a86c2b7546c7cb16e6e50c88cc6
Parents: 796e48c
Author: Feng Liu <feng...@databricks.com>
Authored: Fri Dec 29 15:05:47 2017 +0800
Committer: gatorsmile <gatorsm...@gmail.com>
Committed: Fri Dec 29 15:05:47 2017 +0800

----------------------------------------------------------------------
 .../org/apache/spark/sql/hive/client/IsolatedClientLoader.scala    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/67ea11ea/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/IsolatedClientLoader.scala
----------------------------------------------------------------------
diff --git 
a/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/IsolatedClientLoader.scala
 
b/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/IsolatedClientLoader.scala
index 930f0dd..7a76fd3 100644
--- 
a/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/IsolatedClientLoader.scala
+++ 
b/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/IsolatedClientLoader.scala
@@ -248,7 +248,7 @@ private[hive] class IsolatedClientLoader(
   }
 
   /** The isolated client interface to Hive. */
-  private[hive] def createClient(): HiveClient = {
+  private[hive] def createClient(): HiveClient = synchronized {
     if (!isolationOn) {
       return new HiveClientImpl(version, sparkConf, hadoopConf, config, 
baseClassLoader, this)
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to