pvary commented on a change in pull request #3099:
URL: https://github.com/apache/iceberg/pull/3099#discussion_r722204645



##########
File path: core/src/main/java/org/apache/iceberg/ClientPoolImpl.java
##########
@@ -33,25 +33,32 @@
   private final Deque<C> clients;
   private final Class<? extends E> reconnectExc;
   private final Object signal = new Object();
+  private final boolean retryByDefault;
   private volatile int currentSize;
   private boolean closed;
 
-  public ClientPoolImpl(int poolSize, Class<? extends E> reconnectExc) {
+  public ClientPoolImpl(int poolSize, Class<? extends E> reconnectExc, boolean 
retryByDefault) {
     this.poolSize = poolSize;
     this.reconnectExc = reconnectExc;
     this.clients = new ArrayDeque<>(poolSize);
     this.currentSize = 0;
     this.closed = false;
+    this.retryByDefault = retryByDefault;
   }
 
   @Override
   public <R> R run(Action<R, C, E> action) throws E, InterruptedException {
+    return run(action, retryByDefault);
+  }
+
+  @Override
+  public <R> R run(Action<R, C, E> action, boolean retry) throws E, 
InterruptedException {
     C client = get();
     try {
       return action.run(client);
 
     } catch (Exception exc) {
-      if (isConnectionException(exc)) {
+      if (isConnectionException(exc) && retry) {

Review comment:
       nit: maybe a different order of checks for efficiency?




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