-
Notifications
You must be signed in to change notification settings - Fork 273
Add SO_KEEPALIVE option for upstream connections. #614
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 1 commit
9d38f06
780f785
b60ba8a
83543bd
3580cf6
51d7f1a
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 |
|---|---|---|
|
|
@@ -58,6 +58,20 @@ message SocketAddress { | |
| bool ipv4_compat = 6; | ||
| } | ||
|
|
||
| message TcpKeepalive { | ||
| // Maximum number of keepalive probes to send without response before deciding | ||
| // the connection is dead. Default is to use the OS level configuration (unless | ||
| // overridden, Linux defaults to 9.) | ||
|
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. nit: extra " " after , |
||
| google.protobuf.UInt32Value keepalive_probes = 1; | ||
| // The number of seconds a connection needs to be idle before keep-alive probes | ||
| // start being sent. Default is to use the OS level configuration (unless | ||
| // overridden, Linux defaults to 7200s (ie 2 hours.) | ||
| google.protobuf.UInt32Value keepalive_time = 2; | ||
| // The number of seconds between keep-alive probes. Default is to use the OS | ||
| // level configuration (unless overridden, Linux defaults to 75s. | ||
| google.protobuf.UInt32Value keepalive_interval = 3; | ||
| } | ||
|
|
||
| message BindConfig { | ||
| // The address to bind to when creating a socket. | ||
| SocketAddress source_address = 1 | ||
|
|
@@ -71,6 +85,9 @@ message BindConfig { | |
| // flag is not set (default), the socket is not modified, i.e. the option is | ||
| // neither enabled nor disabled. | ||
| google.protobuf.BoolValue freebind = 2; | ||
|
|
||
| // If set then set SO_KEEPALIVE on the socket to enable TCP Keepalives. | ||
| TcpKeepalive tcp_keepalive = 3; | ||
|
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. Is this tied to the prebind configuration? Or can it be set at any time (e.g. post bind, after
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. My current implementation is only applicable to upstream connections, and is therefore prebind since ClientConnectionImpl only invokes PreBind.
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. I still have a uncomfortable feeling about this grouping. So far,
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. FWIW, I'm going to eventually add keepalive settings on listeners too. So having these in a separate message makes sense to me. But we could put this message into a ConnectionOptions. |
||
| } | ||
|
|
||
| // Addresses specify either a logical or physical address and port, which are | ||
|
|
||
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.
nit: alpha order