hachikuji commented on a change in pull request #10913: URL: https://github.com/apache/kafka/pull/10913#discussion_r660024276
########## File path: raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java ########## @@ -1914,8 +1915,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 || state.isResignRequested()) { Review comment: If you don't mind, let's do this refactor separately. There are a fair number of uses that would benefit from having `Optional<GracefulShutdown>`. -- 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. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org