stevenzwu commented on code in PR #18213:
URL: https://github.com/apache/iceberg/pull/18213#discussion_r4078474999
##########
core/src/main/java/org/apache/iceberg/util/Tasks.java:
##########
@@ -470,6 +479,21 @@ private <E extends Exception> void
runTaskWithRetry(Task<I, E> task, I item) thr
}
}
+ private static boolean causedByInterruption(Throwable throwable) {
+ Throwable current = throwable;
+ while (current != null) {
+ if (current instanceof InterruptedException
+ || current instanceof InterruptedIOException
Review Comment:
`SocketTimeoutException` extends `InterruptedIOException`
([javadoc](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/io/InterruptedIOException.html))
and means a socket read/accept timeout, not `Thread.interrupt()`. A wrapped
timeout would skip retries and set the interrupt flag.
Exclude it: `instanceof InterruptedIOException && !(current instanceof
SocketTimeoutException)`. `InterruptedException` and
`ClosedByInterruptException` do not have this subclass.
##########
core/src/main/java/org/apache/iceberg/util/Tasks.java:
##########
@@ -470,6 +479,21 @@ private <E extends Exception> void
runTaskWithRetry(Task<I, E> task, I item) thr
}
}
+ private static boolean causedByInterruption(Throwable throwable) {
+ Throwable current = throwable;
+ while (current != null) {
+ if (current instanceof InterruptedException
+ || current instanceof InterruptedIOException
+ || current instanceof ClosedByInterruptException) {
+ return true;
+ }
+
+ current = current.getCause() != current ? current.getCause() : null;
Review Comment:
`current.getCause() != null`?
we probably don't even need the null check. just `current =
current.getCause();`
--
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]