envoyproxy / envoy

Cloud-native high-performance edge/middle/service proxy
https://www.envoyproxy.io
Apache License 2.0
25.02k stars 4.82k forks source link

Retry policy that triggers when both status code and response header conditions are satisfied #25542

Open michal-filipiak opened 1 year ago

michal-filipiak commented 1 year ago

Current documentation highlights several ways to set up retries in the retry policy. Still, I can't seem to find an approach based on specific response headers AND specific status codes as a compound condition. retriable-status-codes and retriable-headers can be used together, in which case the retry would happen if either of these is satisfied.

I am looking for a way to retry the request only if a conjunction of response headers and status codes is true. I believe a response header counterpart to retriable_request_headers would work, as the documentation says that the headers there MUST be present for a retry to occur. For response headers though, I found only retriable-headers that trigger a retry whenever a header is matched, regardless of other conditions (in my case status codes). Did I miss something and there is a solution?

wbpcode commented 1 year ago

'AND' semantic is not supported by the retry policy for now.

michal-filipiak commented 1 year ago

Are there any plans for allowing this or is there another possible way to trigger retries on such condition?

wbpcode commented 1 year ago

Are there any plans for allowing this or is there another possible way to trigger retries on such condition?

Sorry, but I cann't figure out a way to achieve this. I will mark this as help wanted because a 'AND' semantic is a reasonable requirement.