kbuci commented on code in PR #18456:
URL: https://github.com/apache/hudi/pull/18456#discussion_r3031693031


##########
hudi-common/src/main/java/org/apache/hudi/common/util/FutureUtils.java:
##########
@@ -42,24 +44,37 @@ public class FutureUtils {
    */
   public static <T> CompletableFuture<List<T>> 
allOf(List<CompletableFuture<T>> futures) {
     CompletableFuture<Void> union = 
CompletableFuture.allOf(futures.toArray(new CompletableFuture[0]));
+    AtomicReference<Throwable> firstFailure = new AtomicReference<>();
 
     futures.forEach(future -> {
       // NOTE: We add a callback to every future, to cancel all the other not 
yet completed futures,
       //       which will be providing for an early termination semantic: 
whenever any of the futures
       //       fail other futures will be cancelled and the exception will be 
returned as a result
       future.whenComplete((ignored, throwable) -> {
         if (throwable != null) {
+          firstFailure.compareAndSet(null, throwable);
+          // Note that {@link CompletableFuture#cancel} does not interrupt the 
other underlying tasks;

Review Comment:
   This comment is unrelated to the fix in this PR. But I wanted to add it 
since it was I misunderstanding I had initially, so wanted to call that out. 



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