From 3a4538880e555168703b9436b1a831ee94be97c5 Mon Sep 17 00:00:00 2001 From: "data-plane-api(Azure Pipelines)" Date: Thu, 10 Jun 2021 20:24:47 +0000 Subject: [PATCH] http2: adding upstream idle timeout ping (#16887) This also fixes a bug with existing keepalive, where if the interval were larger than the idle timeout, it would send new pings and never time out. Risk Level: medium (data plane change, changes existing ping logic) Testing: unit tests Docs Changes: n/a Release Notes: Fixes #16313 Signed-off-by: Alyssa Wilk Mirrored from https://github.com/envoyproxy/envoy @ 79343be05c9528462b51af10b49d5fffe6e173e5 --- envoy/config/core/v3/protocol.proto | 14 ++++++++++---- envoy/config/core/v4alpha/protocol.proto | 14 ++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/envoy/config/core/v3/protocol.proto b/envoy/config/core/v3/protocol.proto index bb199882..cf98e537 100644 --- a/envoy/config/core/v3/protocol.proto +++ b/envoy/config/core/v3/protocol.proto @@ -244,10 +244,8 @@ message Http1ProtocolOptions { message KeepaliveSettings { // Send HTTP/2 PING frames at this period, in order to test that the connection is still alive. - google.protobuf.Duration interval = 1 [(validate.rules).duration = { - required: true - gte {nanos: 1000000} - }]; + // If this is zero, interval PINGs will not be sent. + google.protobuf.Duration interval = 1 [(validate.rules).duration = {gte {nanos: 1000000}}]; // How long to wait for a response to a keepalive PING. If a response is not received within this // time period, the connection will be aborted. @@ -260,6 +258,14 @@ message KeepaliveSettings { // A value of zero means there will be no jitter. // The default value is 15%. type.v3.Percent interval_jitter = 3; + + // If the connection has been idle for this duration, send a HTTP/2 ping ahead + // of new stream creation, to quickly detect dead connections. + // If this is zero, this type of PING will not be sent. + // If an interval ping is outstanding, a second ping will not be sent as the + // interval ping will determine if the connection is dead. + google.protobuf.Duration connection_idle_interval = 4 + [(validate.rules).duration = {gte {nanos: 1000000}}]; } // [#next-free-field: 16] diff --git a/envoy/config/core/v4alpha/protocol.proto b/envoy/config/core/v4alpha/protocol.proto index 2c55569e..abfd1444 100644 --- a/envoy/config/core/v4alpha/protocol.proto +++ b/envoy/config/core/v4alpha/protocol.proto @@ -252,10 +252,8 @@ message KeepaliveSettings { "envoy.config.core.v3.KeepaliveSettings"; // Send HTTP/2 PING frames at this period, in order to test that the connection is still alive. - google.protobuf.Duration interval = 1 [(validate.rules).duration = { - required: true - gte {nanos: 1000000} - }]; + // If this is zero, interval PINGs will not be sent. + google.protobuf.Duration interval = 1 [(validate.rules).duration = {gte {nanos: 1000000}}]; // How long to wait for a response to a keepalive PING. If a response is not received within this // time period, the connection will be aborted. @@ -268,6 +266,14 @@ message KeepaliveSettings { // A value of zero means there will be no jitter. // The default value is 15%. type.v3.Percent interval_jitter = 3; + + // If the connection has been idle for this duration, send a HTTP/2 ping ahead + // of new stream creation, to quickly detect dead connections. + // If this is zero, this type of PING will not be sent. + // If an interval ping is outstanding, a second ping will not be sent as the + // interval ping will determine if the connection is dead. + google.protobuf.Duration connection_idle_interval = 4 + [(validate.rules).duration = {gte {nanos: 1000000}}]; } // [#next-free-field: 16]