szlta commented on code in PR #16780:
URL: https://github.com/apache/iceberg/pull/16780#discussion_r3577333524


##########
core/src/main/java/org/apache/iceberg/util/Tasks.java:
##########
@@ -468,6 +484,41 @@ private <E extends Exception> void 
runTaskWithRetry(Task<I, E> task, I item) thr
         }
       }
     }
+
+    private boolean shouldRetry(Exception exception) {
+      if (shouldRetryPredicate != null) {
+        return shouldRetryPredicate.test(exception);
+      } else if (onlyRetryExceptions != null) {
+        // if onlyRetryExceptions are present, then this retries if one is 
found
+        for (Class<? extends Exception> exClass : onlyRetryExceptions) {
+          if (exClass.isInstance(exception)) {
+            return true;
+          }
+        }
+
+        return false;
+      } else {
+        // otherwise, always retry unless one of the stop exceptions is found
+        for (Class<? extends Exception> exClass : stopRetryExceptions) {
+          if (exClass.isInstance(exception)) {
+            return false;
+          }
+        }
+
+        return true;
+      }
+    }
+
+    private RetryExhaustionReason retryExhaustionReason(

Review Comment:
   I think this could be static



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