You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ratis.apache.org by lj...@apache.org on 2020/04/23 12:27:38 UTC

[incubator-ratis] branch master updated: RATIS-841. Remove unnecessary exception checks in OrderedAsync#sendRequest. Contributed by Lokesh Jain.

This is an automated email from the ASF dual-hosted git repository.

ljain pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ratis.git


The following commit(s) were added to refs/heads/master by this push:
     new 1e909df  RATIS-841. Remove unnecessary exception checks in OrderedAsync#sendRequest. Contributed by Lokesh Jain.
1e909df is described below

commit 1e909dfcd493e32f3a5c47a5533f745715e5669a
Author: Lokesh Jain <lj...@apache.org>
AuthorDate: Thu Apr 23 17:57:05 2020 +0530

    RATIS-841. Remove unnecessary exception checks in OrderedAsync#sendRequest. Contributed by Lokesh Jain.
---
 .../java/org/apache/ratis/client/impl/OrderedAsync.java   | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/ratis-client/src/main/java/org/apache/ratis/client/impl/OrderedAsync.java b/ratis-client/src/main/java/org/apache/ratis/client/impl/OrderedAsync.java
index 27a8c79..88546ca 100644
--- a/ratis-client/src/main/java/org/apache/ratis/client/impl/OrderedAsync.java
+++ b/ratis-client/src/main/java/org/apache/ratis/client/impl/OrderedAsync.java
@@ -28,7 +28,6 @@ import org.apache.ratis.protocol.Message;
 import org.apache.ratis.protocol.NotLeaderException;
 import org.apache.ratis.protocol.RaftClientReply;
 import org.apache.ratis.protocol.RaftClientRequest;
-import org.apache.ratis.protocol.RaftException;
 import org.apache.ratis.protocol.RaftPeerId;
 import org.apache.ratis.retry.RetryPolicy;
 import org.apache.ratis.util.IOUtils;
@@ -236,18 +235,8 @@ public final class OrderedAsync {
     int attemptCount = pending.getAttemptCount();
     return f.thenApply(reply -> {
       LOG.debug("{}: receive* {}", client.getId(), reply);
-      final RaftException replyException = reply != null? reply.getException(): null;
-      reply = client.handleLeaderException(request, reply, this::resetSlidingWindow);
-      if (reply != null) {
-        getSlidingWindow(request).receiveReply(
-            request.getSlidingWindowEntry().getSeqNum(), reply, this::sendRequestWithRetry);
-      } else {
-        final ClientRetryEvent event = new ClientRetryEvent(attemptCount,
-            request, pending.getExceptionCount(replyException), replyException);
-        if (!retryPolicy.handleAttemptFailure(event).shouldRetry()) {
-          handleAsyncRetryFailure(event);
-        }
-      }
+      getSlidingWindow(request).receiveReply(
+          request.getSlidingWindowEntry().getSeqNum(), reply, this::sendRequestWithRetry);
       return reply;
     }).exceptionally(e -> {
       if (LOG.isTraceEnabled()) {