router: add API for retry policy extension#10369
Conversation
Signed-off-by: Yan Xue <yxyan@google.com>
|
cc @kyessenov for utility change |
snowp
left a comment
There was a problem hiding this comment.
Looks pretty good, just a couple comments. Thanks for working on this!
| RetryPolicy retry_policy = 16; | ||
|
|
||
| // [#not-implemented-hide:] | ||
| // Implementation specific configuration which depends on the implementation being instantiated. |
There was a problem hiding this comment.
this description is pretty confusing for someone that doesn't know how the extensions usually work, maybe it should mention that this also defined what implementation is being instantiated?
There was a problem hiding this comment.
I'm confused. RetryPolicy already has a typed config Any. Surely any implementation-specific extension to this should be nested in there?
There was a problem hiding this comment.
RetryPolicy already has a typed config Any
I am not sure if this is true. I didn't find the field with typed Any
envoy/api/envoy/api/v2/route/route_components.proto
Lines 981 to 1075 in d1a36f1
Signed-off-by: Yan Xue <yxyan@google.com>
| // the virtual host level retry policy entirely (e.g.: policies are not merged, most internal one | ||
| // becomes the enforced policy). :ref:`Retry policy <envoy_api_field_route.VirtualHost.retry_policy>` | ||
| // should not be set if this field is used. | ||
| google.protobuf.Any retry_policy_extension = 33; |
There was a problem hiding this comment.
Ditto. What does "See the supported retry policy implementations for further documentation." mean?
There was a problem hiding this comment.
Removed. I mean users can refer to retry policy extensions configuration for details since here is just an Any typed field.
htuch
left a comment
There was a problem hiding this comment.
Putting myself in the shoes of new user, this API documentation is unclear, as it's a magic step to using the field. There are no docs or example of how to use the field. It's unclear if existing RetryPolicy can be embedded here. Also, presumably this is logically a oneof with retry_policy? If not, and it's some extension and to be used with RetryPolicy, again, pretty confusing, this is counter to the way the rest of the API operates.
As API shepherd I'd like to see a clean design here for making retry policies a first class extension point.
|
@htuch the |
Signed-off-by: Yan Xue <yxyan@google.com>
| // will take precedence over this config and it'll be treated independently (e.g.: values are not | ||
| // inherited). :ref:`Retry policy <envoy_api_field_config.route.v3.VirtualHost.retry_policy>` should not be | ||
| // set if this field is used. | ||
| google.protobuf.Any retry_policy_typed_config = 19; |
There was a problem hiding this comment.
Thanks. The API no makes sense. I would also explain in the retry_policy docs that the converse holds. Also, we should add an example retry exension with typed config to the docs. It's OK to take that as an AI for our next PR.
There was a problem hiding this comment.
I would also explain in the retry_policy docs that the converse holds.
I'd like to add the exclusion comment in the retry_policy field but this field is marked as hidden and I cannot refer the field in the doc. Maybe I should just put the field there without reference?
I planned to add the retry policy extension example in the following PRs.
|
/lgtm api |
|
@snowp can you merge if all looks good to you? |
|
Hi folks, this pull request broke master: |
|
@euroelessar thanks! There is a quick fix here #10426 |
|
@yxue great, thanks! |
Signed-off-by: Yan Xue yxyan@google.com
Description: add field for retry policy extension; add utility for converting any to factory config
Risk Level: Low
Testing: Unit test
Docs Changes: N/A
Release Notes: N/A
#Issue #9946