Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider refactoring toward finer control over Response Handling and Retry #731

Closed
kdavisk6 opened this issue Jul 4, 2018 · 3 comments
Closed
Labels
waiting for feedback Issues waiting for a response from either to the author or other maintainers

Comments

@kdavisk6
Copy link
Member

kdavisk6 commented Jul 4, 2018

The current logic treats all IOExceptions from a Client as something that is network related; however, not all of the Client implementations do so. For example, the ApacheHttpClient treat URISyntaxExceptions as IOExceptions, triggering a retry.

Also, all RequestMethods are treated the same. This can lead to retries of POST, PUT, and DELETE methods as outline in #719

Finally, the default Retryer implementation lacks the ability to control if the original exception should be thrown or not. This is called out #709 and #703.

I'd like to start a discussion around which of these the community feels is the most important and how we can go about updating Feign. Thoughts?

@kdavisk6 kdavisk6 added the waiting for feedback Issues waiting for a response from either to the author or other maintainers label Jul 16, 2018
@holy12345
Copy link

Hi @kdavisk6

My thoughts about retries is

  • Have a parameter let clients decide which HttpStatus can retry(such as 500 or 404)

  • Have a parameter let clients decide which HttpMethod can retry(such as GET or POST)

  • I noticed that feign retry mechanism is implemented in an infinite loop.

public class SynchronousMethodHandler {
    @Override
     public Object invoke(Object[] argv) throws Throwable {
         RequestTemplate template = buildTemplateFromArgs.create(argv);
         Retryer retryer = this.retryer.clone();
         while (true) {
             try {
                 return executeAndDecode(template);
              } catch (RetryableException e) {
                retryer.continueOrPropagate(e);
                if (logLevel != Logger.Level.NONE) {
                logger.logRetry(metadata.configKey(), logLevel);
             }
            continue;
          }
     }
}

Can we use some retry tools to complete the retry function(such as spring-retry or guava-retry).

I hope to hear your suggestions.

Thanks : )

@kdavisk6
Copy link
Member Author

kdavisk6 commented Dec 5, 2018

Closing in favor of #709

@kdavisk6 kdavisk6 closed this as completed Dec 5, 2018
@Tal24
Copy link

Tal24 commented Dec 31, 2018

I don't know why it is closed, #709 is about throw the actual exception.
@holy12345 suggests to:
Have a parameter let clients decide which HttpStatus.
I think it is a good suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for feedback Issues waiting for a response from either to the author or other maintainers
Projects
None yet
Development

No branches or pull requests

3 participants