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

Misleading exception message for non-existant partition

    XMLWordPrintableJSON

Details

    • Patch

    Description

      https://issues.apache.org/jira/browse/KAFKA-6833 changed the logic of the KafkaProducer.waitOnMetadata so that if a partition did not exist it would wait for it to exist.
      It means that if called with an incorrect partition the method will eventually throw a TimeoutException, which covers both topic and partition non-existence cases.

      However, the exception message was not changed for the case where metadata.awaitUpdate(version, remainingWaitMs) throws a TimeoutException.

      This results in a confusing exception message. For example, if a producer tries to send to a non-existent partition of an existing topic the message is
      "Topic %s not present in metadata after %d ms.", when timeout via the other code path would come with message
      "Partition %d of topic %s with partition count %d is not present in metadata after %d ms."

      Attachments

        Activity

          People

            mjsax Matthias J. Sax
            tombentley Tom Bentley
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: