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

IncrementalAssignmentConsumerEventHandler throws error when attempting to remove a partition that isn't assigned

    XMLWordPrintableJSON

Details

    Description

      In verifiable_consumer.py, the IncrementalAssignmentConsumerEventHandler contains this logic:

      def handle_partitions_revoked(self, event):
          self.revoked_count += 1
          self.state = ConsumerState.Rebalancing
          self.position = {}
          for topic_partition in event["partitions"]:
              topic = topic_partition["topic"]
              partition = topic_partition["partition"]
              self.assignment.remove(TopicPartition(topic, partition))
      

      If the self.assignment.remove() call is passed a TopicPartition that isn't in the list, a generic Python list error is thrown. For now, we should first check that the TopicPartition is in the list with an assert that provides better information .

      Attachments

        Issue Links

          Activity

            People

              kirktrue Kirk True
              kirktrue Kirk True
              Lucas Brutschy Lucas Brutschy
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: