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 void reconnect() throws MetaException { 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 void close() { 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.