Add retriable headers retry policy.#8187
Conversation
|
@zuercher do you mind taking a look at this? |
zuercher
left a comment
There was a problem hiding this comment.
Nice! Some minor comments, but otherwise looks good.
I believe our current policy is that this needs to be reviewed by @envoyproxy/api-shepherds as well.
b9de585 to
64f4d5c
Compare
64f4d5c to
b6de9b8
Compare
There was a problem hiding this comment.
The spell checker tagged "retrieable". The other test failure looks like a flake.
Also, we prefer not to have force-pushed changes since it can mess up github's comment tracking. We'll squash the commits on merge so you don't have to worry about keeping the history clean.
There was a problem hiding this comment.
Ah, sorry about that: I'll have to force-push one more time b/c I already rebased my branch on upstream master. It shouldn't change the content of existing commits though, as I added new changes as separate commits.
mattklein123
left a comment
There was a problem hiding this comment.
Overall LGTM but from an API perspective I would like to standardize on using HeaderMatcher for something like this. Thank you!
/wait
api/envoy/api/v2/route/route.proto
Outdated
There was a problem hiding this comment.
Can we future proof this by using a repeated HeaderMatcher and related utility functions for this?
Note this change will require release notes.
There was a problem hiding this comment.
Ah, didn't know about HeaderMatcher, seems like a great fit for this, thanks Matt!
There was a problem hiding this comment.
Do you have any preference on how to handle retriable headers provided by the request headers? Some possibilities include:
- support a comma-separated list of header names and construct key-only HeaderMatcher's for them;
- disallow specifying them via request headers at all;
- provide some serialization mechanism for HeaderMatcher.
I like options 1 and 2, as 3 seems too difficult for a user to craft but don't really have strong feelings about that.
There was a problem hiding this comment.
Yeah definitely not (3) IMO. I would be fine with just doing (2) for now and we can see if anyone asks for header specification later / add a TODO (assuming you don't need this).
There was a problem hiding this comment.
Now using HeaderMatcher, PTAL. I kept the header-specified header names but renamed the header to 'x-envoy-retriable-header-names' to make sure it's explicit. We may have a use case for specifying headers that way; at the same time I am not opposed to just removing that if it seems inconsistent.
If we're happy with the change I'll add a release note and docs.
Configured via 'retriable-headers' retry policy and 'retriable_headers' list of headers (both can be set via config or request headers) . If the upstream response has any of the retriable headers set, retry will be triggered. Signed-off-by: Oleg Shaldibin <olegsh@google.com>
Signed-off-by: Oleg Shaldibin <olegsh@google.com>
Signed-off-by: Oleg Shaldibin <olegsh@google.com>
b6de9b8 to
efed86e
Compare
Signed-off-by: Oleg Shaldibin <olegsh@google.com>
|
/retest |
|
🐴 hold your horses - no failures detected, yet. |
mattklein123
left a comment
There was a problem hiding this comment.
API LGTM. Will defer to @zuercher for further review. Thank you!
zuercher
left a comment
There was a problem hiding this comment.
Code looks good!
I should have noticed this before, but we need to update docs/root/configuration/http/http_filters/router_filter.rst.
There should be an entry for retriable-headers under x-envoy-retry-on and an entry for the x-envoy-retriable-headers header that describes the header presence logic and points to the retry config for users that want more complex matching.
Signed-off-by: Oleg Shaldibin <olegsh@google.com>
Signed-off-by: Oleg Shaldibin <olegsh@google.com>
|
Added docs and a release note. |
|
@mattklein123 I also need a re-approval for API (no code changes, just follow-up docs commits). |
Configured via 'retriable-headers' retry policy and 'retriable_headers' list of headers (both can be set via config or request headers) . If the upstream response has any of the retriable headers set, retry will be triggered. Signed-off-by: Oleg Shaldibin <olegsh@google.com>
Configured via 'retriable-headers' retry policy and 'retriable_headers' list of headers (both can be set via config or request headers) . If the upstream response has any of the retriable headers set, retry will be triggered. Signed-off-by: Oleg Shaldibin <olegsh@google.com>
Configured via 'retriable-headers' retry policy and 'retriable_headers' list of headers (both can be set via config or request headers) . If the upstream response has any of the retriable headers set, retry will be triggered. Signed-off-by: Oleg Shaldibin <olegsh@google.com>
Signed-off-by: Oleg Shaldibin olegsh@google.com
Description: implements the retriable headers retry policy as described in #8185.
Risk Level: low.
Testing: unit tests, manual testing.
Docs Changes: TBD.
Release Notes: new 'retriable-headers' retry policy.
Fixes #8185.