virajjasani commented on a change in pull request #1839:
URL: https://github.com/apache/hbase/pull/1839#discussion_r434395602



##########
File path: 
hbase-client/src/main/java/org/apache/hadoop/hbase/client/RawAsyncHBaseAdmin.java
##########
@@ -3521,20 +3522,33 @@ private void getProcedureResult(long procId, 
CompletableFuture<Void> future, int
       return failedFuture(e);
     }
     CompletableFuture<Void> future = new CompletableFuture<>();
-    addListener(ConnectionFactory.createAsyncConnection(peerConf), (conn, err) 
-> {
+    CompletableFuture<AsyncConnection> cf = 
ConnectionFactory.createAsyncConnection(peerConf);
+    addListener(cf, (conn, err) -> {
       if (err != null) {
-        future.completeExceptionally(err);
+        try {
+          future.completeExceptionally(err);
+        } finally {
+          IOUtils.closeQuietly(conn);

Review comment:
       +1 for the above suggestion.




----------------------------------------------------------------
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


Reply via email to