Repository: hive
Updated Branches:
  refs/heads/branch-1.2 97befb75b -> 7a3e79fc0


HIVE-10571 : HiveMetaStoreClient should close existing thrift connection before 
its reconnect (Chaoyu Tang via Szehon)


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

Branch: refs/heads/branch-1.2
Commit: 37e1f833ea1aece3b1e744e6d6db55fdb1514573
Parents: 97befb7
Author: Szehon Ho <sze...@cloudera.com>
Authored: Mon May 4 11:20:36 2015 -0700
Committer: Pengcheng Xiong <pxi...@apache.org>
Committed: Tue Sep 1 16:20:21 2015 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/37e1f833/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
----------------------------------------------------------------------
diff --git 
a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java 
b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
index 41b4ea0..4891d42 100644
--- 
a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
+++ 
b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
@@ -308,6 +308,7 @@ public class HiveMetaStoreClient implements 
IMetaStoreClient {
       throw new MetaException("For direct MetaStore DB connections, we don't 
support retries" +
           " at the client level.");
     } else {
+      close();
       // Swap the first element of the metastoreUris[] with a random element 
from the rest
       // of the array. Rationale being that this method will generally be 
called when the default
       // connection has died and the default connection is likely to be the 
first array element.
@@ -492,7 +493,7 @@ public class HiveMetaStoreClient implements 
IMetaStoreClient {
         client.shutdown();
       }
     } catch (TException e) {
-      LOG.error("Unable to shutdown local metastore client", e);
+      LOG.debug("Unable to shutdown metastore client. Will try closing 
transport directly.", e);
     }
     // Transport would have got closed via client.shutdown(), so we dont need 
this, but
     // just in case, we make this call.

Reply via email to