You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Kirk True (Jira)" <ji...@apache.org> on 2021/07/07 00:25:00 UTC

[jira] [Comment Edited] (KAFKA-12879) Compatibility break in Admin.listOffsets()

    [ https://issues.apache.org/jira/browse/KAFKA-12879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17376128#comment-17376128 ] 

Kirk True edited comment on KAFKA-12879 at 7/7/21, 12:24 AM:
-------------------------------------------------------------

Almost all of the {{Admin}} client's public API methods are meant to be consumed asynchronously. Most of the exceptions that can occur are thrown when the {{Future#get}} method is invoked, not when the {{Admin}} API call itself is invoked.

However, there are some exceptions (pun intended):
 # Creation of the client propagates errors if any occur during configuration
 # {{close}} throws an error if the given {{timeout}} is negative
 # {{deleteTopics}} throws an {{IllegalArgumentException}} if the {{TopicCollection}} parameter is not of an expected sub-class
 # {{updateFeatures}} throws an {{IllegalArgumentException}} if the the {{featureUpdates}} map is empty or contains a blank feature name

The above are just those that are thrown directly in the {{KafkaAdminClient}} itself.

Of the above list, item four seems like it stands out as being extra "picky" compared to, say, {{describeTransactions}}, which doesn't check the collection its given for emptiness.


was (Author: kirktrue):
Almost all of the {{Admin}} client's public API methods are meant to be consumed asynchronously. Most of the exceptions that can occur are thrown when the {{Future#get}} method is invoked.

However, there are some exceptions (pun intended):
 # Creation of the client propagates errors if any occur during configuration
 # {{close}} throws an error if the given {{timeout}} is negative
 # {{deleteTopics}} throws an {{IllegalArgumentException}} if the {{TopicCollection}} parameter is not of an expected sub-class
 # {{updateFeatures}} throws an {{IllegalArgumentException}} if the the {{featureUpdates}} map is empty or contains a blank feature name

The above are just those that are thrown directly in the {{KafkaAdminClient}} itself.

Of the above list, item four seems like it stands out as being extra "picky" compared to, say, {{describeTransactions}}, which doesn't check the collection its given for emptiness.

> Compatibility break in Admin.listOffsets()
> ------------------------------------------
>
>                 Key: KAFKA-12879
>                 URL: https://issues.apache.org/jira/browse/KAFKA-12879
>             Project: Kafka
>          Issue Type: Bug
>          Components: admin
>    Affects Versions: 2.8.0, 2.7.1, 2.6.2
>            Reporter: Tom Bentley
>            Assignee: Kirk True
>            Priority: Major
>
> KAFKA-12339 incompatibly changed the semantics of Admin.listOffsets(). Previously it would fail with {{UnknownTopicOrPartitionException}} when a topic didn't exist. Now it will (eventually) fail with {{TimeoutException}}. It seems this was more or less intentional, even though it would break code which was expecting and handling the {{UnknownTopicOrPartitionException}}. A workaround is to use {{retries=1}} and inspect the cause of the {{TimeoutException}}, but this isn't really suitable for cases where the same Admin client instance is being used for other calls where retries is desirable.
> Furthermore as well as the intended effect on {{listOffsets()}} it seems that the change could actually affect other methods of Admin.
> More generally, the Admin client API is vague about which exceptions can propagate from which methods. This means that it's not possible to say, in cases like this, whether the calling code _should_ have been relying on the {{UnknownTopicOrPartitionException}} or not.



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