You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Brian Byrne (Jira)" <ji...@apache.org> on 2020/05/22 15:44:00 UTC

[jira] [Assigned] (KAFKA-10033) AdminClient should throw UnknownTopicOrPartitionException instead of UnknownServerException if altering configs of non-existing topic

     [ https://issues.apache.org/jira/browse/KAFKA-10033?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Byrne reassigned KAFKA-10033:
-----------------------------------

    Assignee: Brian Byrne

> AdminClient should throw UnknownTopicOrPartitionException instead of UnknownServerException if altering configs of non-existing topic
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-10033
>                 URL: https://issues.apache.org/jira/browse/KAFKA-10033
>             Project: Kafka
>          Issue Type: Improvement
>          Components: admin
>    Affects Versions: 2.4.0
>            Reporter: Gregory Koshelev
>            Assignee: Brian Byrne
>            Priority: Major
>
> Currently, altering configs of non-existing topic leads to {{UnknownServerException}}:
> {code}
> java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.UnknownServerException: Topic "kgn_test" does not exist.
> 	at org.apache.kafka.common.internals.KafkaFutureImpl.wrapAndThrow(KafkaFutureImpl.java:45)
> 	at org.apache.kafka.common.internals.KafkaFutureImpl.access$000(KafkaFutureImpl.java:32)
> 	at org.apache.kafka.common.internals.KafkaFutureImpl$SingleWaiter.await(KafkaFutureImpl.java:89)
> 	at org.apache.kafka.common.internals.KafkaFutureImpl.get(KafkaFutureImpl.java:260)
> 	at ru.kontur.vostok.hercules.stream.manager.kafka.KafkaManager.changeTtl(KafkaManager.java:130)
> 	... 10 common frames omitted
> Caused by: org.apache.kafka.common.errors.UnknownServerException: Topic "kgn_test" does not exist.
> {code}
> The output above is produced due to {{AdminZkClient.validateTopicConfig}} method:
> {code}
>   def validateTopicConfig(topic: String, configs: Properties): Unit = {
>     Topic.validate(topic)
>     if (!zkClient.topicExists(topic))
>       throw new AdminOperationException("Topic \"%s\" does not exist.".format(topic))
>     // remove the topic overrides
>     LogConfig.validate(configs)
>   }
> {code}
> {{UnknownServerException}} is common exception but in this case cause is pretty clear. So this can be fixed easily by using {{UnknownTopicOrPartitionException}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)