You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2019/02/22 08:23:00 UTC

[jira] [Commented] (KAFKA-7962) StickyAssignor: throws NullPointerException during assignments if topic is deleted

    [ https://issues.apache.org/jira/browse/KAFKA-7962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16774898#comment-16774898 ] 

ASF GitHub Bot commented on KAFKA-7962:
---------------------------------------

huxihx commented on pull request #6308: KAFKA-7962: Avoid NPE for StickyAssignor
URL: https://github.com/apache/kafka/pull/6308
 
 
   https://issues.apache.org/jira/browse/KAFKA-7962
   
   Consumer using StickyAssignor throws NullPointerException if a subscribed topic was removed.
   
   *More detailed description of your change,
   if necessary. The PR title and PR message become
   the squashed commit message, so use a separate
   comment to ping reviewers.*
   
   *Summary of testing strategy (including rationale)
   for the feature or bug fix. Unit and/or integration
   tests are expected for any behaviour change and
   system tests should be considered for larger changes.*
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> 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
>         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)