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

conditional retry condition in retry policy #9946

Open
yxue opened this issue Feb 6, 2020 · 3 comments
Open

conditional retry condition in retry policy #9946

yxue opened this issue Feb 6, 2020 · 3 comments
Labels
area/retry design proposal Needs design doc/proposal before implementation help wanted Needs help!

Comments

@yxue
Copy link
Contributor

yxue commented Feb 6, 2020

Description:

defines retry policy for HTTP request. It doesn't support configure different retry policies for different HTTP methods. Users might want to retry on connection failure for all methods but 5xx for idempotent methods only. I think the retry policy should provide such function to allow configure different retry policies for different HTTP methods. More generally, the retry policy should be able to support conditional retry condition.

Relevant Links:
istio/istio#13851

@mattklein123 mattklein123 added the design proposal Needs design doc/proposal before implementation label Feb 6, 2020
@mattklein123
Copy link
Member

At a certain point we probably need to call it quits on adding more and more specific capabilities to the HTTP policy and just make it pluggable. WDYT? cc @snowp

@snowp
Copy link
Contributor

snowp commented Feb 10, 2020

Making the retry policy configurable makes sense to me, we could just pull out the relevant functions from RetryState into a pluggable class. We'd have it be instantiated optionally once per downstream with the request headers (to allow it to parse the retry headers) and then it can just handle the "should this response/reset reason be retried" part that RetryStateImpl is doing today.

This would also make it easier to define composite rules, since we could have those implementation instantiate nested retry policies and delegate the decision to those.

@yxue
Copy link
Contributor Author

yxue commented Feb 19, 2020

I opened a draft PR for making retry policy pluggable. @snowp @mattklein123 could you please take a look if I am on the right track? I think we can have more discussion based on the current implementation.

  1. In the PR, I added a pluggable class which contains a function
  bool shouldRetryHeader(const Http::HeaderMap& request_header, const Http::HeaderMap& response_headers)
  1. Add the pluggable class to the RetryStateImpl which is similar to RetryPrioity and RetryHostPredicate

  2. Add a header retry demo ResponseHeaderRetryHeader which is currently a noop implementation.

@mattklein123 mattklein123 added the no stalebot Disables stalebot from closing an issue label Feb 21, 2020
@mattklein123 mattklein123 added this to the 1.14.0 milestone Feb 21, 2020
@mattklein123 mattklein123 modified the milestones: 1.14.0, 1.15.0 Apr 1, 2020
@mattklein123 mattklein123 modified the milestones: 1.15.0, 1.16.0 Jun 24, 2020
@mattklein123 mattklein123 modified the milestones: 1.16.0, 1.17.0 Oct 4, 2020
@mattklein123 mattklein123 removed this from the 1.17.0 milestone Nov 22, 2020
@mattklein123 mattklein123 added help wanted Needs help! and removed no stalebot Disables stalebot from closing an issue labels Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/retry design proposal Needs design doc/proposal before implementation help wanted Needs help!
Projects
None yet
Development

No branches or pull requests

3 participants