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

org.apache.kafka.clients.consumer.RoundRobinAssignor throws NPE when topic metadata not found

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.10.0.0
    • None
    • None

    Description

      AbstractPartitionAssignor.assign has an ambiguous line in its documentation:

      @param partitionsPerTopic The number of partitions for each subscribed topic (may be empty for some topics)
      

      Does empty mean the topic has an entry with value zero, or that the entry is excluded from the map altogether? The current implementation in AbstractPartitionAssignor excludes the entry from partitionsPerTopic if the topic isn't in the metadata.

      RoundRobinAssignorTest.testOneConsumerNonexistentTopic interprets emptiness as providing the topic with a zero value.

      RangeAssignor interprets emptiness as excluding the entry from the map.

      RangeAssignorTest.testOneConsumerNonexistentTopic interprets emptiness as providing the topic with a zero value.

      I don't really have a preference in which direction we take. We just need to more clearly document what happens when the topic isn't in the metadata.

      Attachments

        Activity

          People

            onurkaraman Onur Karaman
            onurkaraman Onur Karaman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: