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


##########
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;
+          synchronized (this) {
+            close(client);
+            currentSize -= 1;
+          }
+          synchronized (signal) {

Review Comment:
   Thanks for the feedback. You’re right that `notifyAll()` should only be 
called when a client is actually returned to the pool. I’ll remove this code.



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