Sophie Blee-Goldman created KAFKA-9132:
------------------------------------------

             Summary: Refactor StreamThread to take advantage of new 
ConsumerRebalanceListener exception handling
                 Key: KAFKA-9132
                 URL: https://issues.apache.org/jira/browse/KAFKA-9132
             Project: Kafka
          Issue Type: Improvement
          Components: streams
    Affects Versions: 2.4.0
            Reporter: Sophie Blee-Goldman


As part of KIP-429 we solved the long-standing issue where exceptions thrown 
during the ConsumerRebalanceListener's callbacks were swallowed, and changed 
the behavior so that these exceptions are now bubbled all the way up to the 
Consumer#poll call.

Because of the original behavior, any exceptions thrown during task creation, 
suspension, closure, etc. had to be caught by the rebalance listener and passed 
on to the calling StreamThread by setting a "rebalanceException" field. This 
then has to be checked after every polling loop.

We should refactor this in light of the new & fixed behavior, so that we can 
simply catch rebalance exceptions thrown from poll rather than check for them 
explicitly after every call. This has the additional benefit of being able to 
react to it immediately (whereas currently we have to go through the remainder 
of the entire `StreamThread#runOnce` loop before we notice the exception.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to