xintongsong commented on PR #21137: URL: https://github.com/apache/flink/pull/21137#issuecomment-1301630684
Thanks @reswqa for the fix, and thanks all for the discussion. For this specific case, I think it indeed can be fixed either way, introducing a thread or making sure `leaderElectionService.stop()` is called outside the lock scope. However, from the perspective of maintenance, I think having a dedicated `handleLeaderEventExecutor` is easier to understand and maintain compared to carefully decide which lines of code needs to be executed under lock and which needn't. Admittedly, it comes with a price of an extra thread, which is probably fine in this one-per-contender case. So +1 for the current approach. The PR LGTM. -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org