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

StickyAssignor: throws NullPointerException during assignments if topic is deleted

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.0
    • 2.3.0
    • consumer
    • None
    • 1. MacOS, com.salesforce.kafka.test.KafkaTestUtils (kind of embedded kafka integration tests)
      2. Linux, dockerised kafka and our service

    Description

      Integration tests with  com.salesforce.kafka.test.KafkaTestUtils, local setup, StickyAssignor used, local topics are created / removed, one topic is created in the beginning of test and without unsubscribing from it - deleted.

      Same happens in real environment.

       

      1. have single "topic" with 1 partition
      2. single consumer subscribed to this "topic" (StickyAssignor)
      3. delete "topic"

      =>

      • rebalance starts, topic partition(s) is revoked
      • on assignment StickyAssignor throws exception (line 223), because partitionsPerTopic.("topic") returns null in for loop (topic deleted - no partitions are present)

       

      In the provided log part, tearDown() causes topic deletion, while consumer still running and tries to poll data from topic.

      RangeAssignor works fine (revokes partition, assigns empty set).

      Problem doesn't have workaround (like handle i in onPartitionsAssigned and remove unsubscribe topic), because everything happens before listener called.

       

      Attachments

        Issue Links

          Activity

            People

              huxi_2b huxihx
              smolbo Oleg Smirnov
              Vahid Hashemian Vahid Hashemian
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: