http: global connection manager per-stream idle timeouts. (#3879)

This is a followup to #3841, where we introduce HCM-wide stream idle timeouts. This has two effects:

1. We can now timeout immediately after stream creation, potentially before receiving request headers and routing.

2. A default timeout can be configured across all routes. This is overridable on a per-route basis.

The default and overriding semantics are explained in the docs. Also added as a bonus some docs
about how timeouts interact more generally in Envoy.

Fixes #3853.

Risk Level: Low. While there is some change to the per-route vs. HCM wide semantics for stream idle
timeouts, it's not anticipated this feature is in common use yet (it's only a couple of days since
landing), and the caveats in #3841 with the new 5 minute default timeout should already apply.
Testing: Unit/integration tests added.

Signed-off-by: Harvey Tuch <htuch@google.com>

Mirrored from https://github.com/envoyproxy/envoy @ 672083c7ba4e92fe9548252c45d84d583a95102d
pull/620/head
data-plane-api(CircleCI) 7 years ago
parent fcd1470c8f
commit 38249244f7
  1. 11
      envoy/api/v2/route/route.proto
  2. 29
      envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.proto

@ -439,12 +439,11 @@ message RouteAction {
google.protobuf.Duration per_try_timeout = 3 [(gogoproto.stdduration) = true];
}
// Specifies the idle timeout for the route. If not specified, this defaults
// to 5 minutes. The default value was select so as not to interfere with any
// smaller configured timeouts that may have existed in configurations prior
// to the introduction of this feature, while introducing robustness to TCP
// connections that terminate without FIN. A value of 0 will completely
// disable the idle timeout.
// Specifies the idle timeout for the route. If not specified, there is no per-route idle timeout
// specified, although the connection manager wide :ref:`stream_idle_timeout
// <envoy_api_field_config.filter.network.http_connection_manager.v2.HttpConnectionManager.stream_idle_timeout>`
// will still apply. A value of 0 will completely disable the route's idle timeout, even if a
// connection manager stream idle timeout is configured.
//
// The idle timeout is distinct to :ref:`timeout
// <envoy_api_field_route.RouteAction.timeout>`, which provides an upper bound

@ -19,7 +19,7 @@ import "gogoproto/gogo.proto";
// [#protodoc-title: HTTP connection manager]
// HTTP connection manager :ref:`configuration overview <config_http_conn_man>`.
// [#comment:next free field: 24]
// [#comment:next free field: 25]
message HttpConnectionManager {
enum CodecType {
option (gogoproto.goproto_enum_prefix) = false;
@ -137,6 +137,33 @@ message HttpConnectionManager {
// <envoy_api_field_config.filter.network.http_connection_manager.v2.HttpConnectionManager.drain_timeout>`.
google.protobuf.Duration idle_timeout = 11 [(gogoproto.stdduration) = true];
// The stream idle timeout for connections managed by the connection manager.
// If not specified, this defaults to 5 minutes. The default value was selected
// so as not to interfere with any smaller configured timeouts that may have
// existed in configurations prior to the introduction of this feature, while
// introducing robustness to TCP connections that terminate without a FIN.
//
// This idle timeout applies to new streams and is overridable by the
// :ref:`route-level idle_timeout
// <envoy_api_field_route.RouteAction.idle_timeout>`. Even on a stream in
// which the override applies, prior to receipt of the initial request
// headers, the :ref:`stream_idle_timeout
// <envoy_api_field_config.filter.network.http_connection_manager.v2.HttpConnectionManager.stream_idle_timeout>`
// applies. Each time an encode/decode event for headers or data is processed
// for the stream, the timer will be reset. If the timeout fires, the stream
// is terminated with a 408 Request Timeout error code if no upstream response
// header has been received, otherwise a stream reset occurs.
//
// Note that it is possible to idle timeout even if the wire traffic for a stream is non-idle, due
// to the granularity of events presented to the connection manager. For example, while receiving
// very large request headers, it may be the case that there is traffic regularly arriving on the
// wire while the connection manage is only able to observe the end-of-headers event, hence the
// stream may still idle timeout.
//
// A value of 0 will completely disable the connection manager stream idle
// timeout, although per-route idle timeout overrides will continue to apply.
google.protobuf.Duration stream_idle_timeout = 24 [(gogoproto.stdduration) = true];
// The time that Envoy will wait between sending an HTTP/2 shutdown
// notification (GOAWAY frame with max stream ID) and a final GOAWAY frame.
// This is used so that Envoy provides a grace period for new streams that

Loading…
Cancel
Save