Repository: hive Updated Branches: refs/heads/master fa4c81ade -> 8fb805225
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/8fb80522 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/8fb80522 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/8fb80522 Branch: refs/heads/master Commit: 8fb805225c9d6960c7d39d862de6b3326650551c Parents: fa4c81a Author: Szehon Ho <sze...@cloudera.com> Authored: Mon May 4 11:20:36 2015 -0700 Committer: Szehon Ho <sze...@cloudera.com> Committed: Mon May 4 11:20:59 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/8fb80522/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 de577ab..f5816a0 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.