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 support for configuring Envoys route idle_timeout into release/1.14.x #15611

Conversation

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

Backport

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

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

This PR adds support for configuring the Envoy route level idle_timeout for service-routers and local_app. For our teams scenario, this will let us extend the timeout for long-running gRPC services so that Envoy doesn't terminate the connection prematurely.

For service-routers a IdleTimeout parameter has been added, and for local_app a proxy config local_idle_timeout_ms parameter was created. I followed the RequestTimeout and local_request_timeout_ms definitions closely.

Testing & Reproduction steps

Manual Testing Steps

service-router IdleTimeout

Created a service-router and configured the IdleTimeout to 60s

Kind = "service-router"
Name = "waitserver"
Routes = [
  {
    Destination {
      Service = ""
      RequestTimeout = "60m"
      IdleTimeout = "60s"
    }
  }
]

Dumped the Envoy config and verified that the idle_timeout configuration parameter was set

<snip>
        "name": "waitserver",
        "domains": [
         "*"
        ],
        "routes": [
         {
          "match": {
           "prefix": "/"
          },
          "route": {
           "cluster": "waitserver.default.dc1.internal.ba4be18f-a3c7-7e2f-eff4-a25a8a1fce57.consul",
           "timeout": "3600s",
           "idle_timeout": "60s"
          }
         },
<snip>
local_idle_timeout_ms

Configure local_idle_timeout_ms on a service proxy.config

service {
  name = "waitserver"
  id = "waitserver"
  address = "10.5.0.20"
  port = 9222

  connect {
    sidecar_service {
      port = 10201

      proxy {
        config {
          local_request_timeout_ms = 0
          local_idle_timeout_ms = 0
        }
      }
      check {
        name = "Connect Envoy Sidecar"
        tcp = "10.5.0.20:10201"
        interval ="10s"
      }
    }
  }
}

Dumped the Envoy config and verified that the idle_timeout configuration parameter was set on the public_listener route for local_app

{
     "route_config": {
      "@type": "type.googleapis.com/envoy.config.route.v3.RouteConfiguration",
      "name": "public_listener",
      "virtual_hosts": [
       {
        "name": "public_listener",
        "domains": [
         "*"
        ],
        "routes": [
         {
          "match": {
           "prefix": "/"
          },
          "route": {
           "cluster": "local_app",
           "timeout": "0s",
           "idle_timeout": "0s"
          }
         }
        ]
       }
      ]
     },

Links

Include any links here that might be helpful for people reviewing your PR (Tickets, GH issues, API docs, external benchmarks, tools docs, etc). If there are none, feel free to delete this section.

Please be mindful not to leak any customer or confidential information. HashiCorp employees may want to use our internal URL shortener to obfuscate links.

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/oulman-add-idle-timeout/literally-measured-honeybee branch from 67e7a3c to c5dd81e Compare November 29, 2022 22:43
@hashicorp-cla
Copy link

hashicorp-cla commented Nov 29, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

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

* Add idleTimeout

Co-authored-by: Jeff Boruszak <104028618+boruszak@users.noreply.github.com>
Co-authored-by: Dhia Ayachi <dhia@hashicorp.com>
@DanStough DanStough force-pushed the backport/oulman-add-idle-timeout/literally-measured-honeybee branch from ca7d5cc to b177de9 Compare November 29, 2022 22:48
@DanStough DanStough marked this pull request as ready for review November 29, 2022 22:48
@DanStough DanStough requested a review from a team as a code owner November 29, 2022 22:48
@DanStough DanStough merged commit 7c0eec4 into release/1.14.x Nov 29, 2022
@DanStough DanStough deleted the backport/oulman-add-idle-timeout/literally-measured-honeybee branch November 29, 2022 22:58
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.

None yet

5 participants