Skip to content

Commit

Permalink
[#11050] Replace StopFlag with CompletableFuture.cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
emeroad committed Jun 5, 2024
1 parent 8e569f7 commit 821b2c6
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import java.util.List;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
Expand Down Expand Up @@ -72,7 +71,7 @@ public void appendServerInfo(final Range range, final NodeList source, final Lin
} else {
try {
CompletableFuture.allOf(futures).get(timeoutMillis, TimeUnit.MILLISECONDS);
} catch (InterruptedException | ExecutionException | TimeoutException e) {
} catch (Throwable e) {
CompletableFuture.allOf(futures).cancel(false);
String cause = "an error occurred while adding server info";
if (e instanceof TimeoutException) {
Expand Down

0 comments on commit 821b2c6

Please # to comment.