133tosakarin commented on code in PR #1143:
URL: https://github.com/apache/ratis/pull/1143#discussion_r1742405544
##########
ratis-server/src/main/java/org/apache/ratis/server/impl/LeaderElection.java:
##########
@@ -234,12 +234,17 @@ LifeCycle.State getCurrentState() {
@Override
public void run() {
+ if (server.initializing()) {
+ LOG.info("{}: skip running since the server is initializing", this);
+ return;
+ }
if (!lifeCycle.compareAndTransition(STARTING, RUNNING)) {
final LifeCycle.State state = lifeCycle.getCurrentState();
LOG.info("{}: skip running since this is already {}", this, state);
return;
}
+
Review Comment:
Sorry, I deleted this blank line, but forgot to push it again.
The implementation you provided is very good, I will modify it right away
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]