You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ha...@apache.org on 2017/11/07 15:51:23 UTC

hive git commit: HIVE-17229 : HiveMetastore HMSHandler locks during initialization, even though its static variable threadPool is not null (Zac Zhou via Rajesh Balamohan)

Repository: hive
Updated Branches:
  refs/heads/master aee0eaa03 -> 7ea12e731


HIVE-17229 : HiveMetastore HMSHandler locks during initialization, even though its static variable threadPool is not null (Zac Zhou via Rajesh Balamohan)

Signed-off-by: Ashutosh Chauhan <ha...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/7ea12e73
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/7ea12e73
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/7ea12e73

Branch: refs/heads/master
Commit: 7ea12e731e416da18da333e005c49b40c0a61434
Parents: aee0eaa
Author: Zac Zhou <yu...@163.com>
Authored: Wed Aug 2 03:18:00 2017 -0700
Committer: Ashutosh Chauhan <ha...@apache.org>
Committed: Tue Nov 7 07:50:16 2017 -0800

----------------------------------------------------------------------
 .../apache/hadoop/hive/metastore/HiveMetaStore.java | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/7ea12e73/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
----------------------------------------------------------------------
diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
index 0fcb93e..f29a20d 100644
--- a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
@@ -425,13 +425,15 @@ public class HiveMetaStore extends ThriftHiveMetastore {
       super(name);
       hiveConf = conf;
       isInTest = HiveConf.getBoolVar(hiveConf, ConfVars.HIVE_IN_TEST);
-      synchronized (HMSHandler.class) {
-        if (threadPool == null) {
-          int numThreads = HiveConf.getIntVar(conf,
-              ConfVars.METASTORE_FS_HANDLER_THREADS_COUNT);
-          threadPool = Executors.newFixedThreadPool(numThreads,
-              new ThreadFactoryBuilder().setDaemon(true)
-                  .setNameFormat("HMSHandler #%d").build());
+      if (threadPool == null) {
+        synchronized (HMSHandler.class) {
+          if (threadPool == null) {
+            int numThreads = HiveConf.getIntVar(conf,
+                ConfVars.METASTORE_FS_HANDLER_THREADS_COUNT);
+            threadPool = Executors.newFixedThreadPool(numThreads,
+                new ThreadFactoryBuilder().setDaemon(true)
+                    .setNameFormat("HMSHandler #%d").build());
+          }
         }
       }
       if (init) {