From ed4b38b8fec7a4636d349b41b98987ca81750c1e Mon Sep 17 00:00:00 2001 From: Aleksei Zotov Date: Sat, 21 Oct 2023 06:08:41 +0700 Subject: [PATCH] Suppress UnknownServerException for topic DESCRIBE_CONFIGS --- .../java/io/kafbat/ui/service/ReactiveAdminClient.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api/src/main/java/io/kafbat/ui/service/ReactiveAdminClient.java b/api/src/main/java/io/kafbat/ui/service/ReactiveAdminClient.java index 4c345d633..7f71e62e0 100644 --- a/api/src/main/java/io/kafbat/ui/service/ReactiveAdminClient.java +++ b/api/src/main/java/io/kafbat/ui/service/ReactiveAdminClient.java @@ -77,6 +77,7 @@ import org.apache.kafka.common.errors.InvalidRequestException; import org.apache.kafka.common.errors.SecurityDisabledException; import org.apache.kafka.common.errors.TopicAuthorizationException; +import org.apache.kafka.common.errors.UnknownServerException; import org.apache.kafka.common.errors.UnknownTopicOrPartitionException; import org.apache.kafka.common.errors.UnsupportedVersionException; import org.apache.kafka.common.requests.DescribeLogDirsResponse; @@ -246,8 +247,8 @@ public Mono>> getTopicsConfig() { return listTopics(true).flatMap(topics -> getTopicsConfig(topics, false)); } - //NOTE: skips not-found topics (for which UnknownTopicOrPartitionException was thrown by AdminClient) - //and topics for which DESCRIBE_CONFIGS permission is not set (TopicAuthorizationException was thrown) + //NOTE: skips not-found topics (for which UnknownTopicOrPartitionException or UnknownServerException was thrown by + // AdminClient) and topics for which DESCRIBE_CONFIGS permission is not set (TopicAuthorizationException was thrown) public Mono>> getTopicsConfig(Collection topicNames, boolean includeDoc) { var includeDocFixed = includeDoc && getClusterFeatures().contains(SupportedFeature.CONFIG_DOCUMENTATION_RETRIEVAL); // we need to partition calls, because it can lead to AdminClient timeouts in case of large topics count @@ -269,6 +270,9 @@ private Mono>> getTopicsConfigImpl(Collection config.entrySet().stream() .collect(toMap(