hachikuji commented on a change in pull request #10913: URL: https://github.com/apache/kafka/pull/10913#discussion_r656452042
########## File path: raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java ########## @@ -1914,8 +1917,7 @@ private long pollLeader(long currentTimeMs) { LeaderState<T> state = quorum.leaderStateOrThrow(); maybeFireLeaderChange(state); - GracefulShutdown shutdown = this.shutdown.get(); - if (shutdown != null) { + if (shutdown.get() != null || resignedEpoch.get() == state.epoch()) { Review comment: Check the logic in `maybeShutdown`. I think the way we do this today is that observers and followers are immediately shutdown. So we would never call `pollUnattached` or `pollFollower` while shutting down. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org