hachikuji commented on a change in pull request #10913: URL: https://github.com/apache/kafka/pull/10913#discussion_r656402618
########## 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: The main difference is the behavior of the Resigned state itself. When the client is shutting down, we will not transition out of the resigned state (or any other state) to become a candidate. -- 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