amaliujia commented on code in PR #1647:
URL: https://github.com/apache/ratis/pull/1647#discussion_r4333404217
##########
ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerProxy.java:
##########
@@ -125,6 +125,9 @@ public synchronized void close() {
return;
}
isClosed = true;
+ // Notify all the state machines upfront: the close tasks submitted
below each wait for the committed entries
+ // to be applied, so a task queued behind them could otherwise be
delayed for an unbounded time.
+ map.values().forEach(f -> f.thenAccept(impl ->
impl.notifyServerShutdownInitiated(true)));
Review Comment:
I was thinking about if `close` used by `parallelForEachAsync` runs in a
limited thread pool so the event was not able to send out sooner . So a
up-front call might be able to accelerate this.
But this maybe just over-kill. I ended up with removing this up-front call.
The minimal we need is just to pair with those post shutdown events.
--
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]