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

Guozhang Wang commented on KAFKA-8313:
--------------------------------------

Just a few more words on why the threads' being shutdown: during the rebalance 
which is triggered by the deletion of the topic, the leader would realize that 
the target source topic does not exist (any more), and hence it will propagate 
this error code to all the members telling them to shutdown, which is normal.

The issue here though, as you already described, is that when threads are 
shutting down gracefully, the state listener was not being notified because of 
the issue above. I think it should have been fixed by now.

I'm resolving this ticket now but in case you found it was not the case, please 
feel free to re-open.

> KafkaStreams state not being updated properly after shutdown
> ------------------------------------------------------------
>
>                 Key: KAFKA-8313
>                 URL: https://issues.apache.org/jira/browse/KAFKA-8313
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>    Affects Versions: 2.2.0
>         Environment: Single broker running on Ubuntu Linux.
>            Reporter: Eric
>            Priority: Minor
>         Attachments: kafka-8313-src.tgz, log.txt
>
>
> I am running a KafkaStreams inside a DropWizard server and I am trying to 
> detect when my stream shuts down (in case a non-recoverable error occurs).  I 
> was hoping I could use KafkaStreams.setStateListener() to be notified when a 
> state change occurs.  When I query the state, KafkaStreams is stuck in the 
> REBALANCING state even though its threads are all DEAD.
>  
> You can easily reproduce this by doing the following:
>  # Create a topic (I have one with 5 partitions)
>  # Create a simple Kafka stream consuming from that topic
>  # Create a StateListener and register it on that KafkaStreams
>  # Start the Kafka stream
>  # Once everything runs, delete the topic using kafka-topics.sh
> When deleting the topic, you will see the StreamThreads' state transition 
> from RUNNING to PARTITION_REVOKED and you will be notified with the 
> KafkaStreams REBALANCING state.  That's all good and expected.  Then the 
> StreamThreads transition to PENDING_SHUTDOWN and eventually to DEAD and the 
> KafkaStreams state is stuck into the REBALANCING thread.  I was expecting to 
> see a NOT_RUNNING state eventually... am I right?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to