abhishekagarwal87 commented on code in PR #15975:
URL: https://github.com/apache/druid/pull/15975#discussion_r1503632884


##########
server/src/main/java/org/apache/druid/client/DirectDruidClient.java:
##########
@@ -494,6 +504,12 @@ public void onFailure(Throwable t)
           Execs.directExecutor()
       );
     }
+    catch (RuntimeException e) {
+      if (openConnections.get() > 0) {
+        openConnections.getAndDecrement();
+      }
+      throw e;
+    }

Review Comment:
   This could be moved to after `httpClient.go` call. Also, why not decrement 
the counter for any exception and why is there a check on `get() > 0`



##########
server/src/test/java/org/apache/druid/client/DirectDruidClientTest.java:
##########
@@ -143,33 +147,33 @@ public void testRun() throws Exception
     SettableFuture<InputStream> futureResult = SettableFuture.create();
     Capture<Request> capturedRequest = EasyMock.newCapture();
     EasyMock.expect(
-        httpClient.go(
-            EasyMock.capture(capturedRequest),
-            EasyMock.<HttpResponseHandler>anyObject(),
-            EasyMock.anyObject(Duration.class)
-        )
-    )
+                httpClient.go(
+                    EasyMock.capture(capturedRequest),
+                    EasyMock.<HttpResponseHandler>anyObject(),
+                    EasyMock.anyObject(Duration.class)
+                )
+            )

Review Comment:
   This re-formatting shouldn't have happened. Are you using a different 
checkstyle? 



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to