Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-7808

AdminClient#describeTopics should not throw InvalidTopicException if topic name is not found

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2.0
    • Component/s: admin, core
    • Labels:
      None

      Description

      In AdminClient#describeTopics, we have the following logic:

              if (!cluster.topics().contains(topicName)) {
                              future.completeExceptionally(new InvalidTopicException("Topic " + topicName + " not found."));
                              continue;
                          }
      

      However, InvalidTopicException is a non-retriable exception and is used to indicate that topic contains invalid chars or topic name is too long etc, and hence not correct to use. We should, instead, throw the retriable UnknownTopicOrPartitionException instead.

      We should make sure any callers on this logic should be cleaned up when fixing it.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dongjin Lee Dongjin
                Reporter:
                guozhang Guozhang Wang
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: