From 821b2c6679d16797ebfbf515158574edc2397740 Mon Sep 17 00:00:00 2001 From: emeroad Date: Wed, 5 Jun 2024 11:41:57 +0900 Subject: [PATCH] [#11050] Replace StopFlag with CompletableFuture.cancel --- .../appender/server/DefaultServerInfoAppender.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web/src/main/java/com/navercorp/pinpoint/web/applicationmap/appender/server/DefaultServerInfoAppender.java b/web/src/main/java/com/navercorp/pinpoint/web/applicationmap/appender/server/DefaultServerInfoAppender.java index 682fd21379f8..5edf7c0482a1 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/applicationmap/appender/server/DefaultServerInfoAppender.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/applicationmap/appender/server/DefaultServerInfoAppender.java @@ -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; @@ -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) {