Details
Description
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.
Attachments
Issue Links
- causes
-
KAFKA-13770 Regression when Connect uses 0.10.x brokers due to recently added retry logic in KafkaBasedLog
- Resolved
- is caused by
-
KAFKA-12339 Add retry to admin client's listOffsets
- Resolved
-
KAFKA-14821 Better handle timeouts in ListOffsets API
- Resolved
- is related to
-
KAFKA-15425 Compatibility break in Admin.listOffsets() (2)
- Resolved
- links to