Configurable socket keep alive interval
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:
- TCP_KEEPIDLE
- TCP_KEEPINTVL
- TCP_KEEPCNT
Reference: https://github.com/reactor/reactor-netty/issues/2167
@vietj I can add this feature, just need the permission to branch.
@aksabg please contribute it via a pull request
@vietj I don't have permissions to create a remote branch required for a pull request.
@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.
@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.
@jakub-id the issue is that the PR does not have an eclipse agreement signed
@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.
@vietj @jakub-id I have signed the agreement (https://accounts.eclipse.org/users/vealrad) Is there anything else I need to do?
@aksabg Great! Can you remove the JavaDoc formatting changes and empty new lines as @vietj asked on the PR?
where is the PR ?
@vietj https://github.com/eclipse-vertx/vert.x/pull/5183