aasha commented on a change in pull request #1655:
URL: https://github.com/apache/hive/pull/1655#discussion_r519571307



##########
File path: 
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
##########
@@ -798,14 +798,14 @@ public void close() {
     // just in case, we make this call.
     if ((transport != null) && transport.isOpen()) {
       transport.close();
-      final int newCount = connCount.decrementAndGet();
-      LOG.info("Closed a connection to metastore, current connections: {}",
-          newCount);
       if (LOG.isTraceEnabled()) {
         LOG.trace("METASTORE CONNECTION TRACE - close [{}]",
             System.identityHashCode(this), new Exception());
       }
     }
+    final int newCount = connCount.decrementAndGet();

Review comment:
       this should be done only if client is not null at the first place. 
otherwise if you just keep calling close it will keep decrementing




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to