[
https://issues.apache.org/jira/browse/KAFKA-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Vahid Hashemian resolved KAFKA-7962.
------------------------------------
Resolution: Fixed
Reviewer: Vahid Hashemian
Fix Version/s: 2.3.0
> StickyAssignor: throws NullPointerException during assignments if topic is
> deleted
> ----------------------------------------------------------------------------------
>
> Key: KAFKA-7962
> URL: https://issues.apache.org/jira/browse/KAFKA-7962
> Project: Kafka
> Issue Type: Bug
> Components: consumer
> Affects Versions: 2.1.0
> Environment: 1. MacOS, com.salesforce.kafka.test.KafkaTestUtils (kind
> of embedded kafka integration tests)
> 2. Linux, dockerised kafka and our service
> Reporter: Oleg Smirnov
> Assignee: huxihx
> Priority: Major
> Fix For: 2.3.0
>
> Attachments: NPE-StickyAssignor-issues.apache.log
>
>
> 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.
>
> # have single "topic" with 1 partition
> # single consumer subscribed to this "topic" (StickyAssignor)
> # 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.
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)