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

Backport of Add ServiceResolver RequestTimeout for route timeouts to make TerminatingGateway upstream timeouts configurable into release/1.15.x #16520

Conversation

hc-github-team-consul-core
Copy link
Contributor

Backport

This PR is auto-generated from #16495 to be assessed for backporting due to the inclusion of the label backport/1.15.

WARNING automatic cherry-pick of commits failed. Commits will require human attention.

merge conflict error: POST https://api.github.com/repos/hashicorp/consul/merges: 409 Merge conflict []

The below text is copied from the body of the original PR.


Description

I'm not entirely sure about this approach because it's unclear to me where we generally use ConnectTimeout for ServiceResolvers and whether or not this is conflating two timeout values that shouldn't be conflated. If so, I can add another timeout value that makes this configurable. Edit: Adding a RequestTimeout parameter for ServiceResolvers to handle the timeout. That said, this change allows for overriding Envoy's default timeout for establishing connections to upstream clusters in a route configuration.

I tested it manually with a custom go binary run on the mesh with a TerminatingGateway and ServiceResolver that extends the timeout to 30 seconds so that a server that takes 20 seconds to respond doesn't timeout. I'll be adding some sort of integration test, but wanted to open this to get eyes on the approach first.

Note that two changes are necessary for this to work with terminating gateways, the first is to allow the local proxy that a service uses to route traffic through the mesh to configure the timeout for its routes via makeUpstreamRouteForDiscoveryChain, the second is to have the TerminatingGateway itself configure its routing timeouts via makeNamedDefaultRouteWithLB.

Testing & Reproduction steps

The files I used to manually validate are here. I compiled main.go as timeout-check, copied it to the root of the consul directory and locally compiled consul. I then booted up Consul, ran the timeout-check.sh script and issued a curl to localhost:9877 to kick off a request through the service mesh to the external sleeping service. Without this change I see:

~ curl localhost:9877
upstream request timeout%

With it I see:

~ curl localhost:9877
finished%

PR Checklist

  • updated test coverage
  • external facing docs updated
  • not a security concern

Overview of commits

@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/terminating-gateway-timeouts/terminally-normal-adder branch 2 times, most recently from 57b1145 to 3ed979c Compare March 3, 2023 14:37
@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/terminating-gateway-timeouts/terminally-normal-adder branch from 3ed979c to 57b1145 Compare March 3, 2023 14:37
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto approved Consul Bot automated PR

@github-actions github-actions bot added the theme/envoy/xds Related to Envoy support label Mar 3, 2023
@andrewstucki andrewstucki marked this pull request as ready for review March 3, 2023 14:43
@andrewstucki andrewstucki requested a review from a team as a code owner March 3, 2023 14:43
@andrewstucki
Copy link
Contributor

Slight diff drift from having to regenerate the proto files from a merge conflict.

@andrewstucki andrewstucki merged commit f51d12c into release/1.15.x Mar 3, 2023
@andrewstucki andrewstucki deleted the backport/terminating-gateway-timeouts/terminally-normal-adder branch March 3, 2023 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/envoy/xds Related to Envoy support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants