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

Configurable socket keep alive interval #5163

Closed
aksabg opened this issue Mar 22, 2024 · 11 comments
Closed

Configurable socket keep alive interval #5163

aksabg opened this issue Mar 22, 2024 · 11 comments
Milestone

Comments

@aksabg
Copy link

aksabg commented Mar 22, 2024

NetServer now supports tcpKeepAlive flag which is translated to Netty's SO_KEEPALIVE flag. However, the keepalive interval, idle time and count cannot be set through settings, which means it defaults to OS values (usually the idle time is 2 hours).

When using NetServer in conjuction with the AWS load balancer, the connections are closed when idle for more than 350 seconds.

The following Netty fields should be supported in NetServerOptions:

  1. TCP_KEEPIDLE
  2. TCP_KEEPINTVL
  3. TCP_KEEPCNT

Reference: reactor/reactor-netty#2167

@aksabg
Copy link
Author

aksabg commented Mar 22, 2024

@vietj I can add this feature, just need the permission to branch.

@vietj
Copy link
Member

vietj commented Mar 27, 2024

@aksabg please contribute it via a pull request

@aksabg
Copy link
Author

aksabg commented Mar 27, 2024

@vietj I don't have permissions to create a remote branch required for a pull request.

@jakub-id
Copy link

@vietj any chance to get this merged? This is a PITA to configure externally on Kubernetes < 1.29 where configuring these defaults via sysctl is considered unsafe.

@jakub-id
Copy link

jakub-id commented Sep 10, 2024

@vietj Please review this. It's essential that those options can be configured from the code as Linux defaults are completely unusable. For comparison Go not only allows controlling this (https://pkg.go.dev/net#KeepAliveConfig) but also enables TCP keepalive by default with idle=15s, interval=15s and count=9 settings which are much more sensible than the defaults.

@vietj
Copy link
Member

vietj commented Sep 11, 2024

@jakub-id the issue is that the PR does not have an eclipse agreement signed

@jakub-id
Copy link

@vietj I saw that but the Eclipse report is weird as her email is mentioned once in the green box and three times in the red box. Unless it's a different email but it doesn't look like it.

@aksabg
Copy link
Author

aksabg commented Sep 11, 2024

@vietj @jakub-id I have signed the agreement (https://accounts.eclipse.org/users/vealrad)
Is there anything else I need to do?

@jakub-id
Copy link

@aksabg Great! Can you remove the JavaDoc formatting changes and empty new lines as @vietj asked on the PR?

@vietj
Copy link
Member

vietj commented Sep 17, 2024

where is the PR ?

@aksabg
Copy link
Author

aksabg commented Sep 17, 2024

@vietj
#5183

@vietj vietj added this to the 4.5.11 milestone Sep 20, 2024
@vietj vietj closed this as completed Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants