-
Notifications
You must be signed in to change notification settings - Fork 5.3k
network: delayed conn close #4382
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
Changes from all commits
4d2426e
94a835a
e2176aa
3a67ecb
30eb02e
9ddf9d3
8e716eb
e71f798
6130f28
890471e
aae3b52
b8eb565
6071d31
36b6087
d056d7a
52c10d9
9d86332
435a518
f2c81ed
6704243
31bcaaa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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: 25] | ||
| // [#comment:next free field: 27] | ||
| message HttpConnectionManager { | ||
| enum CodecType { | ||
| option (gogoproto.goproto_enum_prefix) = false; | ||
|
|
@@ -175,6 +175,25 @@ message HttpConnectionManager { | |
| // option is not specified. | ||
| google.protobuf.Duration drain_timeout = 12 [(gogoproto.stdduration) = true]; | ||
|
|
||
| // The delayed close timeout is for downstream connections managed by the HTTP connection manager. | ||
| // It is defined as a grace period after connection close processing has been locally initiated | ||
| // during which Envoy will flush the write buffers for the connection and await the peer to close | ||
| // (i.e., a TCP FIN/RST is received by Envoy from the downstream connection). | ||
| // | ||
| // Delaying Envoy's connection close and giving the peer the opportunity to initate the close | ||
| // sequence mitigates a race condition that exists when downstream clients do not drain/process | ||
| // data in a connection's receive buffer after a remote close has been detected via a socket | ||
| // write(). This race leads to such clients failing to process the response code sent by Envoy, | ||
| // which could result in erroneous downstream processing. | ||
| // | ||
| // If the timeout triggers, Envoy will close the connection's socket. | ||
| // | ||
| // The default timeout is 1000 ms if this option is not specified. | ||
| // | ||
| // A value of 0 will completely disable delayed close processing, and the downstream connection's | ||
| // socket will be closed immediately after the write flush is completed. | ||
| google.protobuf.Duration delayed_close_timeout = 26 [(gogoproto.stdduration) = true]; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry I forget this from before. Can you add this to the release notes also with a link to this field?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
|
|
||
| // Configuration for :ref:`HTTP access logs <arch_overview_access_logs>` | ||
| // emitted by the connection manager. | ||
| repeated envoy.config.filter.accesslog.v2.AccessLog access_log = 13; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -153,7 +153,8 @@ HttpConnectionManagerConfig::HttpConnectionManagerConfig( | |
| date_provider_(date_provider), | ||
| listener_stats_(Http::ConnectionManagerImpl::generateListenerStats(stats_prefix_, | ||
| context_.listenerScope())), | ||
| proxy_100_continue_(config.proxy_100_continue()) { | ||
| proxy_100_continue_(config.proxy_100_continue()), | ||
| delayed_close_timeout_(PROTOBUF_GET_MS_OR_DEFAULT(config, delayed_close_timeout, 1000)) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like the default is 1 second if the proto field isn't set - we should document that above.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
|
|
||
| route_config_provider_ = Router::RouteConfigProviderUtil::create(config, context_, stats_prefix_, | ||
| route_config_provider_manager_); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see some documentation on why one would change this setting. It's talked about in the linked issue, but from just reading this documentation, I wouldn't know what could go wrong if I change this setting to 0/disabled here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.