keepConcentration commented on code in PR #8547:
URL: https://github.com/apache/gravitino/pull/8547#discussion_r2354357394


##########
core/src/main/java/org/apache/gravitino/utils/ClientPoolImpl.java:
##########
@@ -55,14 +55,24 @@ public <R> R run(Action<R, C, E> action) throws E, 
InterruptedException {
   @Override
   public <R> R run(Action<R, C, E> action, boolean retry) throws E, 
InterruptedException {
     C client = get();
+    boolean shouldRelease = true;
     try {
       return action.run(client);
 
     } catch (Exception exc) {
       if (retry && isConnectionException(exc)) {
         try {
           client = reconnect(client);
-        } catch (Exception ignored) {
+        } catch (Exception reconnectException) {
+          shouldRelease = false;

Review Comment:
   Thank you for the review. @yuqi1129 
   
   The `shouldRelease` flag is used in the finally block to control whether a 
client should be returned to the pool when it becomes unusable for reasons 
other than a connection exception.



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

Reply via email to