nastra commented on a change in pull request #3215:
URL: https://github.com/apache/iceberg/pull/3215#discussion_r721387312
##########
File path: core/src/main/java/org/apache/iceberg/util/Tasks.java
##########
@@ -213,7 +214,7 @@ public boolean run(Task<I, RuntimeException> task) {
try {
runTaskWithRetry(task, item);
succeeded.add(item);
-
+ threw = false;
Review comment:
that makes sense, but then I believe we can simplify the code to the one
below as `throwFailureWhenFinished && threw` is always `false` according to the
IDE?
```
--- a/core/src/main/java/org/apache/iceberg/util/Tasks.java
+++ b/core/src/main/java/org/apache/iceberg/util/Tasks.java
@@ -270,12 +270,9 @@ public class Tasks {
if (throwFailureWhenFinished && !exceptions.isEmpty()) {
Tasks.throwOne(exceptions, exceptionClass);
- } else if (throwFailureWhenFinished && threw) {
- throw new RuntimeException(
- "Task set failed with an uncaught throwable");
}
- return !threw;
+ return true;
```
--
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]