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

question: How to implement retries for Dynamic Backend? #1767

Closed
yury-kozlov opened this issue May 3, 2021 · 2 comments
Closed

question: How to implement retries for Dynamic Backend? #1767

yury-kozlov opened this issue May 3, 2021 · 2 comments

Comments

@yury-kozlov
Copy link

yury-kozlov commented May 3, 2021

We intend use dynamic backends in our routes (defined in Route Groups CRD), but couldn't figure out the proper way to handle retries: for example if dynamic backend returns invalid response (e.g. timeout) how can we tell skipper to give it another try?

So far, we found only two alternatives:

  1. use Load Balancer Backend instead of dynamic backend which automatically provides retry infra. The downside, if I understand it right, is that it will be impossible to dynamically resolve backend addresses from code.
  2. use CustomHttpRoundTripperWrap + implement our own retry mechanism.
@aryszka
Copy link
Contributor

aryszka commented May 4, 2021

thanks for the question. If I understand correctly what you described, this is not supported out-of-the-box. Skipper only does a single retry for failed TCP connects, but doesn't do retries for application layer failures, e.g. for 500s received from the backend. This is something that is considered to be a decision of the client. This applies to the LB backend.

your proposed alternative approach (2) of using a custom roundtripper may work. However, my personal opinion is that delegating this kind of functionality to a roundtripper in Skipper can be hard to address in a generic way, because I expect too many edge cases, like when and when not to retry, that depend on application layer considerations. It may not be in the best place in a roundtripper. If you decide to experiment with this options, please let us know how it works out.

@AlexanderYastrebov
Copy link
Member

Related feature request #1473

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants