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

Custom conditions for retrying proxy requests #6267

Open
mholt opened this issue Apr 24, 2024 · 0 comments
Open

Custom conditions for retrying proxy requests #6267

mholt opened this issue Apr 24, 2024 · 0 comments
Labels
feature ⚙️ New feature or request help wanted 🆘 Extra attention is needed

Comments

@mholt
Copy link
Member

mholt commented Apr 24, 2024

As discussed in #4245 (comment), it could be useful to have a way to further customize when requests are retried by the load balancer while proxying. As far as I know, all of that comment is now supported/implemented except this part:

Maybe it should be possible to retry for some of these cases, on an opt-in basis (taken from https://cbonte.github.io/haproxy-dconv/2.4/configuration.html#4.2-retry-on). Some of these can be risky but we should let the user choose if they want it:

  • Empty response (no response body) or socket closed before receiving a response
  • On TLS handshake error (I'm not sure if we already do for these or not, but writing it down here for now)
  • Response timeout (i.e. response_header_timeout HTTP transport option, or read_timeout fastcgi transport option), i.e. server took too long to respond
  • By response status code (e.g. server actually responded with 503 Service Unavailable from an upstream proxy)

As always, non-GET/HEAD/OPTIONS requests that are retried for any reason other than "the connection to the backend failed" is unsafe by default, so the user would have to carefully configure conditions in which the request is idempotent and may be retried. One common example is an Idempotency-Key header which the backend app must honor (properly implement).

Opening this issue as a more focused discussion on just this remaining facet of the whole previous discussion.

@mholt mholt added help wanted 🆘 Extra attention is needed feature ⚙️ New feature or request labels Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature ⚙️ New feature or request help wanted 🆘 Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant