Skip to content

Commit

Permalink
RATIS-2100. The closeFuture never completed while closing from the …
Browse files Browse the repository at this point in the history
…`NEW` state (#1102)
  • Loading branch information
chungen0126 committed May 25, 2024
1 parent 93eb32a commit 640749b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,11 @@ private void run() {
};

public CompletableFuture<State> tryToClose() {
if (lifeCycle.transition(TRY_TO_CLOSE) == CLOSING) {
final State state = lifeCycle.transition(TRY_TO_CLOSE);
if (state == CLOSING) {
daemon.interrupt();
} else if (state == CLOSED) {
closeFuture.complete(state);
}
return closeFuture;
}
Expand Down

0 comments on commit 640749b

Please sign in to comment.