@omkreddy Thanks for the comments. There is indeed a race condition between 
clearing the queue when handling `ControllerMovedException` and closing 
ControllerEventManager. Because we use a special event to interrupt and 
shutdown the controller event thread, if  `ControllerMovedException` happens 
after we put the shutdown event into the queue and before event thread picks it 
up, the shutdown event get cleared when handling `ControllerMovedException`.

To resolve it, I added the `isShuttingDown` flag to ensure that the event queue 
will not be cleared if the shutdown event has been put into the queue.

[ Full content available at: https://github.com/apache/kafka/pull/5101 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to