rpuch commented on code in PR #5099:
URL: https://github.com/apache/ignite-3/pull/5099#discussion_r1926744104
##########
modules/raft/src/main/java/org/apache/ignite/internal/raft/server/impl/JraftServerImpl.java:
##########
@@ -830,8 +785,12 @@ public void result(Serializable res) {
st = new Status(RaftError.ESTATEMACHINE, "Unknown state
machine error.");
}
- if (iter.done() != null) {
- iter.done().run(st);
+ // This is necessary so that IndexOutOfBoundsException is not
thrown in a situation where the listener, when processing a
+ // command, catch any exception and does clo.result(throwable)
and then throws the caught exception.
Review Comment:
Thanks for the explaining comment! Could you please expand it a bit: say
that `clo.result(throwable)` actually advances the iterator, so next call to
`done()` would have caused an out-of-bounds access.
--
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]