Cyrill commented on code in PR #6569:
URL: https://github.com/apache/ignite-3/pull/6569#discussion_r2439808897
##########
modules/raft/src/main/java/org/apache/ignite/raft/jraft/core/NodeImpl.java:
##########
@@ -1620,8 +1621,18 @@ else if (this.state.compareTo(State.STATE_TRANSFERRING)
<= 0) {
}
// Should be in readLock
- private boolean isLearner() {
- return this.conf.listLearners().contains(this.serverId);
+ private boolean isLearner(boolean blocking) {
+ if (!blocking) {
Review Comment:
What about something like this?
```
private boolean isLearnerUnsafe() {
return this.conf.listLearners().contains(this.serverId);
}
private boolean isLearner() {
this.readLock.lock();
try {
return isLearnerUnsafe();
}
finally {
this.readLock.unlock();
}
}
```
--
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]