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

outbound: add request timeout fields #243

Merged
merged 2 commits into from
Jun 1, 2023
Merged

Conversation

hawkw
Copy link
Contributor

@hawkw hawkw commented May 26, 2023

This branch adds fields to the OutboundPolicies API messages for configuring request timeouts. The HttpRoute.Rule and GrpcRoute.Rule messages now contain a requestTimeout field, which contains a Duration for a request timeout for that rule. In addition, the RouteBackend messages also contain a requestTimeout field, which configures a duration for requests dispatched to that specific backend. All new fields have comments describing their intended semantics.

This branch adds fields to the `OutboundPolicies` API messages for
configuring request timeouts. The `HttpRoute.Rule` and `GrpcRoute.Rule`
messages now contain a `requestTimeout` field, which contains a
`Duration` for a request timeout for that rule. In addition, the
`RouteBackend` messages also contain a `requestTimeout` field, which
configures a duration for requests dispatched to that specific backend.
All new fields have comments describing their intended semantics.
@hawkw hawkw requested review from adleong and a team May 26, 2023 18:37
@hawkw hawkw merged commit 58c5242 into main Jun 1, 2023
@hawkw hawkw deleted the eliza/client-policy-timeouts branch June 1, 2023 20:18
hawkw added a commit to linkerd/linkerd2 that referenced this pull request Jun 2, 2023
PR #10969 adds support for the GEP-1742 `timeouts` field to the
HTTPRoute CRD. This branch implements actual support for these fields in
the policy controller. The timeout fields are now read and used to set
the timeout fields added to the proxy-api in
linkerd/linkerd2-proxy-api#243.

In addition, I've added code to ensure that the timeout fields are
parsed correctly when a JSON manifest is deserialized. The current
implementation represents timeouts in the bindings as a Rust
`std::time::Duration` type. `Duration` does implement
`serde::Deserialize` and `serde::Serialize`, but its serialization
implementation attempts to (de)serialize it as a struct consisting of a
number of seconds and a number of subsecond nanoseconds. The timeout
fields are instead supposed to be represented as strings in the Go
standard library's `time.ParseDuration` format. Therefore, I've added a
newtype which wraps the Rust `std::time::Duration` and implements the
same parsing logic as Go. Eventually, I'd like to upstream the
implementation of this to `kube-rs`; see kube-rs/kube#1222 for details.

Depends on #10969
Depends on linkerd/linkerd2-proxy-api#243

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
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

Successfully merging this pull request may close these issues.

4 participants