Skip to content

quiche: add connection keepalive support - #18260

Merged
ggreenway merged 18 commits into
envoyproxy:mainfrom
danzh2010:keepalive
Oct 22, 2021
Merged

ggreenway merged 18 commits into
envoyproxy:mainfrom
danzh2010:keepalive

Conversation

@danzh2010

Copy link
Copy Markdown
Contributor

Signed-off-by: Dan Zhang [email protected]

Commit Message: keepalive probing can be configured in envoy.config.core.v3.QuicProtocolOptions for upstream and downstream. If absent, use the QUICHE default behavior which sends PING frame every 15s on client side and no-op on server side.

Risk Level: low
Testing: added integration tests
Fixes #16751

@repokitteh-read-only

Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/envoy/.
envoyproxy/api-shepherds assignee is @lizan
CC @envoyproxy/api-watchers: FYI only for changes made to api/envoy/.

🐱

Caused by: #18260 was opened by danzh2010.

see: more, trace.

@danzh2010

Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only

Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #18260 (comment) was created by @danzh2010.

see: more, trace.

@danzh2010

Copy link
Copy Markdown
Contributor Author

coverage CI fails because kill_request:kill_request_filter_integration_test, which seems unrelated.

@danzh2010

Copy link
Copy Markdown
Contributor Author

/assign @ggreenway @RyanTheOptimist

Comment thread api/envoy/config/core/v3/protocol.proto Outdated
// :ref:`connection idle_timeout <envoy_v3_api_field_config.listener.v3.QuicProtocolOptions.idle_timeout>` to
// prevent idle timeout while not too small to throttle the connection or to flood the peer.
// If zero, disable keepalive probing.
google.protobuf.UInt32Value max_interval = 1 [(validate.rules).message = {required: true}];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: since this is simply a number (and not an std::duration or QuicTimeDelta) let's add _seconds to the name in order to make the units obvious.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread api/envoy/config/core/v3/protocol.proto Outdated
//
// If zero, disable keepalive probing for a server connection. For a client
// connection, if max_interval is also zero, do not keepalive, otherwise use max_interval to probe all the time.
google.protobuf.UInt32Value initial_interval = 2 [(validate.rules).message = {required: true}];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

}

bool EnvoyQuicClientSession::ShouldKeepConnectionAlive() const {
return !disable_keepalive_ && quic::QuicSpdyClientSession::ShouldKeepConnectionAlive();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This seems slightly scary to me, but this seems to do what the feature request is for so I guess it's good to go :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The docs imply that setting keepalive just causes extra traffic to solicit traffic from the peer, but doesn't directly alter the lifetime of the connection. Please explain what's going on here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ShouldKeepConnectionAlive() is used by QUICHE to decide if it should probe the peer at all.

Comment thread api/envoy/config/core/v3/protocol.proto Outdated
// If zero, disable keepalive probing.
google.protobuf.UInt32Value max_interval = 1 [(validate.rules).message = {required: true}];

// The interval in seconds to send the first 6 keep-alive probing packet to prevent

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: packet => packets

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread api/envoy/config/core/v3/protocol.proto Outdated
google.protobuf.UInt32Value max_interval = 1 [(validate.rules).message = {required: true}];

// The interval in seconds to send the first 6 keep-alive probing packet to prevent
// connection from idle timeout. The following probing will be sent, each

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

... to prevent the connection from hitting the idle timeout. Subsequent probes will be sent, each ...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread api/envoy/config/core/v3/protocol.proto Resolved
Signed-off-by: Dan Zhang <[email protected]>
RyanTheOptimist
RyanTheOptimist previously approved these changes Oct 1, 2021

@RyanTheOptimist RyanTheOptimist left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>

@ggreenway ggreenway left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/wait

Comment thread api/envoy/config/core/v3/protocol.proto Resolved
Comment thread api/envoy/config/core/v3/protocol.proto Resolved
Comment thread api/envoy/config/core/v3/protocol.proto Resolved
Comment thread api/envoy/config/core/v3/protocol.proto Resolved
}

bool EnvoyQuicClientSession::ShouldKeepConnectionAlive() const {
return !disable_keepalive_ && quic::QuicSpdyClientSession::ShouldKeepConnectionAlive();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The docs imply that setting keepalive just causes extra traffic to solicit traffic from the peer, but doesn't directly alter the lifetime of the connection. Please explain what's going on here.

Signed-off-by: Dan Zhang <[email protected]>
@danzh2010

Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only

Copy link
Copy Markdown

Retrying Azure Pipelines:
Check envoy-presubmit didn't fail.

🐱

Caused by: a #18260 (comment) was created by @danzh2010.

see: more, trace.

@danzh2010

Copy link
Copy Markdown
Contributor Author

Ping?

@ggreenway

Copy link
Copy Markdown
Member

Need api signoff; @lizan is assigned (but he's probably busy with kubecon this week). @htuch did you have any more comments on the API?

/wait-any

Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
@danzh2010

Copy link
Copy Markdown
Contributor Author

@lizan PTAL!

@danzh2010

Copy link
Copy Markdown
Contributor Author

@htuch PTAL

@htuch htuch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

API LGTM modulo some docs nits.

Comment thread api/envoy/config/core/v3/protocol.proto Resolved
Comment thread api/envoy/config/core/v3/protocol.proto Resolved
@danzh2010

Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only

Copy link
Copy Markdown

Retrying Azure Pipelines:
Check envoy-presubmit isn't fully completed, but will still attempt retrying.
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #18260 (comment) was created by @danzh2010.

see: more, trace.

@danzh2010

Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only

Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #18260 (comment) was created by @danzh2010.

see: more, trace.

@htuch htuch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm api

@danzh2010

danzh2010 commented Oct 21, 2021 •

Copy link
Copy Markdown
Contributor Author

@ggreenway you requested change early on. PTAL and merge if it looks okay.

@ggreenway
ggreenway merged commit 30e0c70 into envoyproxy:main Oct 22, 2021
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.

Support keep-alive in QUIC downstream and make it configurable

6 participants