TCP: per-client idle timeout for tcp conn pool (#23947)

While we return the connection to the pool, the idle timeout starts ticking until the connection is reused.
If the timeout fires, we closes the connection and let the pool knows.

Fixes #23699

Signed-off-by: kuochunghsu <kuochunghsu@pinterest.com>

Mirrored from https://github.com/envoyproxy/envoy @ 57b1c7213327ce6a505d7a8e2209db31561f85d0
pull/626/head
data-plane-api(Azure Pipelines) 2 years ago
parent fff396e3d0
commit c65cd6eeca
  1. 1
      BUILD
  2. 9
      envoy/extensions/upstreams/tcp/v3/BUILD
  3. 45
      envoy/extensions/upstreams/tcp/v3/tcp_protocol_options.proto
  4. 1
      versioning/BUILD

@ -296,6 +296,7 @@ proto_library(
"//envoy/extensions/upstreams/http/tcp/v3:pkg",
"//envoy/extensions/upstreams/http/v3:pkg",
"//envoy/extensions/upstreams/tcp/generic/v3:pkg",
"//envoy/extensions/upstreams/tcp/v3:pkg",
"//envoy/extensions/wasm/v3:pkg",
"//envoy/extensions/watchdog/profile_action/v3:pkg",
"//envoy/service/accesslog/v3:pkg",

@ -0,0 +1,9 @@
# DO NOT EDIT. This file is generated by tools/proto_format/proto_sync.py.
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package")
licenses(["notice"]) # Apache 2
api_proto_package(
deps = ["@com_github_cncf_udpa//udpa/annotations:pkg"],
)

@ -0,0 +1,45 @@
syntax = "proto3";
package envoy.extensions.upstreams.tcp.v3;
import "google/protobuf/duration.proto";
import "udpa/annotations/status.proto";
option java_package = "io.envoyproxy.envoy.extensions.upstreams.tcp.v3";
option java_outer_classname = "TcpProtocolOptionsProto";
option java_multiple_files = true;
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/upstreams/tcp/v3;tcpv3";
option (udpa.annotations.file_status).package_version_status = ACTIVE;
// [#protodoc-title: TCP Protocol Options]
// [#extension: envoy.upstreams.tcp.tcp_protocol_options]
// TCProtocolOptions specifies TCP upstream protocol options. This object
// is used in
// :ref:`typed_extension_protocol_options<envoy_v3_api_field_config.cluster.v3.Cluster.typed_extension_protocol_options>`,
// keyed by the name ``envoy.extensions.upstreams.tcp.v3.TcpProtocolOptions``.
//
// .. code::
//
// clusters:
// - name: some_service
// connect_timeout: 5s
// typed_extension_protocol_options:
// envoy.extensions.upstreams.tcp.v3.TcpProtocolOptions:
// "@type": type.googleapis.com/envoy.extensions.upstreams.tcp.v3.TcpProtocolOptions
// idle_timeout: 10m
// .... [further cluster config]
message TcpProtocolOptions {
// The idle timeout for the connection. The idle timeout is defined as the period in which
// the connection is not associated with a downstream connection. When the idle timeout is
// reached, the connection will be closed.
//
// If not set, the default idle timeout is 10 minutes. To disable idle timeouts, explicitly set this to 0.
//
// .. warning::
// Disabling this timeout has a highly likelihood of yielding connection leaks due to lost TCP
// FIN packets, etc.
google.protobuf.Duration idle_timeout = 1;
}

@ -234,6 +234,7 @@ proto_library(
"//envoy/extensions/upstreams/http/tcp/v3:pkg",
"//envoy/extensions/upstreams/http/v3:pkg",
"//envoy/extensions/upstreams/tcp/generic/v3:pkg",
"//envoy/extensions/upstreams/tcp/v3:pkg",
"//envoy/extensions/wasm/v3:pkg",
"//envoy/extensions/watchdog/profile_action/v3:pkg",
"//envoy/service/accesslog/v3:pkg",

Loading…
Cancel
Save