diff --git metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java index 3988b6a..5d823bb 100644 --- metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java +++ metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java @@ -368,13 +368,15 @@ public HMSHandler(String name, HiveConf conf) throws MetaException { public HMSHandler(String name, HiveConf conf, boolean init) throws MetaException { super(name); hiveConf = conf; - 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) {