SzyWilliam commented on code in PR #794:
URL: https://github.com/apache/ratis/pull/794#discussion_r1037042847


##########
ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerImpl.java:
##########
@@ -921,11 +921,11 @@ ReadRequests getReadRequests() {
   }
 
   private CompletableFuture<ReadIndexReplyProto> sendReadIndexAsync() {
-    if (getInfo().getLeaderId() == null) {
-      JavaUtils.completeExceptionally(generateNotLeaderException());
+    final RaftPeerId leaderId = getInfo().getLeaderId();
+    if (leaderId == null) {
+      return JavaUtils.completeExceptionally(generateNotLeaderException());

Review Comment:
   Recently I discovered the `NotLeaderException` will be handled by 
`RaftClient` automatically and count one retry attempt. Shall we change the 
exception here to `ReadIndexException("not leader")` ?



-- 
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]

Reply via email to