[ 
https://issues.apache.org/jira/browse/RATIS-310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16609860#comment-16609860
 ] 

Tsz Wo Nicholas Sze commented on RATIS-310:
-------------------------------------------

In sendRequestWithRetry, it should not sleep if it is not retrying.  Also, the 
code will be simpler if we keep using for-loop.
{code}
    for(int retryCount = 0;; retryCount++) {
      final RaftClientRequest request = supplier.get();
      final RaftClientReply reply = sendRequest(request);
      if (reply != null) {
        return reply;
      }
      if (!retryPolicy.shouldRetry(retryCount)) {
        return null;
      }
      try {
        retryPolicy.getSleepTime().sleep();
      } catch (InterruptedException e) {
        throw new InterruptedIOException("retry policy=" + retryPolicy);
      }
    }
{code}

> Add support for Retry Policy in Ratis
> -------------------------------------
>
>                 Key: RATIS-310
>                 URL: https://issues.apache.org/jira/browse/RATIS-310
>             Project: Ratis
>          Issue Type: Bug
>            Reporter: Shashikant Banerjee
>            Assignee: Shashikant Banerjee
>            Priority: Major
>              Labels: ozone
>         Attachments: RATIS-310.03.patch
>
>
> Currently, ratis retries indefinitely if a client request fails. This Jira 
> aims to add retryPolicy in Ratis which :
> 1) Adds a policy to retry with a fixed count and with fixed sleep interval
> 2) Default policy is set to RETRY_FOREVER



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to