Skip to content
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

[3.5] Refactor the keepAliveListener and keepAliveConn #14366

Merged
merged 1 commit into from
Aug 24, 2022

Conversation

ahrtr
Copy link
Member

@ahrtr ahrtr commented Aug 20, 2022

Partially cherry pick #14356 to 3.5.

When starting etcd using ./etcd --socket-reuse-address --socket-reuse-port, actually etcd setting the SetKeepAlive or SetKeepAlivePeriod fails, but the current code ignores the errors. This issue can happen on both Linux and Mac.

Only net.TCPConn supports SetKeepAlive and SetKeepAlivePeriod
by default, so if you want to warp multiple layers of net.Listener,
the keepaliveListener should be the one which is closest to the
original net.Listener implementation, namely TCPListener.

Signed-off-by: Benjamin Wang wachao@vmware.com

Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.

cc @spzala @serathius @ptabor

Only `net.TCPConn` supports `SetKeepAlive` and `SetKeepAlivePeriod`
by default, so if you want to warp multiple layers of net.Listener,
the `keepaliveListener` should be the one which is closest to the
original `net.Listener` implementation, namely `TCPListener`.

Also refer to etcd-io#14356

Signed-off-by: Benjamin Wang <wachao@vmware.com>
Copy link
Member

@spzala spzala left a comment

Choose a reason for hiding this comment

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

@ahrtr thank you, lgtm but a small suggestion to update changelog for 3.5.5 if that sounds good to you.

@ahrtr
Copy link
Member Author

ahrtr commented Aug 21, 2022

@ahrtr thank you, lgtm but a small suggestion to update changelog for 3.5.5 if that sounds good to you.

@spzala Yes, I will submit a separate PR to update the changelog for 3.5 on the main branch later. thx

ahrtr added a commit to ahrtr/etcd that referenced this pull request Aug 21, 2022
…eListener and keepAliveConn

Refer to etcd-io#14366,
Also refer to etcd-io#14356

Signed-off-by: Benjamin Wang <wachao@vmware.com>
@ahrtr
Copy link
Member Author

ahrtr commented Aug 24, 2022

This is just a backport PR, so let me merge it. If there are any other comments, we can address them in the main branch firstly.

@ahrtr
Copy link
Member Author

ahrtr commented Aug 24, 2022

Thanks @spzala

@ahrtr ahrtr merged commit 74aa38e into etcd-io:release-3.5 Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants