Skip to content

Support extended keepalive parameters in epoll and io_uring#6089

Open
ivu-mawi wants to merge 4 commits into
eclipse-vertx:masterfrom
ivu-mawi:epoll-keepalive-extended-params-master
Open

Support extended keepalive parameters in epoll and io_uring#6089
ivu-mawi wants to merge 4 commits into
eclipse-vertx:masterfrom
ivu-mawi:epoll-keepalive-extended-params-master

Conversation

@ivu-mawi
Copy link
Copy Markdown

@ivu-mawi ivu-mawi commented Apr 29, 2026

EpollTransport: support extended keepalive parameters TCP_KEEPIDLE, TCP_KEEPCNT and TCP_KEEPINTVL

Builds on #5183. This work has not made it into master, so I'm catching up on that.

I hope I've ported it correctly given the refactoring of the TCPSSLOptions / TCPConfig.

For motivation, see #5163 and #5183 and #5970

@vietj
Copy link
Copy Markdown
Member

vietj commented Apr 29, 2026

I am wondering for the new config to potentially have an Option object to be more extensible than what we have now.

@vietj
Copy link
Copy Markdown
Member

vietj commented Apr 30, 2026

@ivu-mawi I have introduced generic TCP option, can you rebase on master

@vietj
Copy link
Copy Markdown
Member

vietj commented Apr 30, 2026

that only affects the new config

@ivu-mawi
Copy link
Copy Markdown
Author

Seems good! I'll gladly rebase when I get the chance, which will be next week only I'm afraid.

@tsegismont
Copy link
Copy Markdown
Member

No problem @ivu-mawi . Thank you!

@ivu-mawi ivu-mawi force-pushed the epoll-keepalive-extended-params-master branch from 9a4a2f0 to fd5a51c Compare May 6, 2026 15:34
@ivu-mawi ivu-mawi changed the title EpollTransport: support extended keepalive parameters Support extended keepalive parameters in epoll and io_uring May 6, 2026
@vietj vietj marked this pull request as ready for review May 7, 2026 13:18
@vietj vietj marked this pull request as draft May 7, 2026 13:18
@vietj
Copy link
Copy Markdown
Member

vietj commented May 7, 2026

why is that PR still in draft mode ?

@ivu-mawi
Copy link
Copy Markdown
Author

ivu-mawi commented May 7, 2026

I'm trying to verify locally that it actually works. But I can't seem to get packet capturing to work in WSL (Windows subsystem for linux), and that's the only Linux I have access to at the moment. :(

I'll give up the test. Code is ready, I'll mark it ready.

@ivu-mawi ivu-mawi marked this pull request as ready for review May 7, 2026 13:23
@vietj vietj added this to the 5.1.0 milestone May 12, 2026
@vietj
Copy link
Copy Markdown
Member

vietj commented May 18, 2026

@ivu-mawi an you rebase on latest branch to resolve the git conflict ?

@ivu-mawi ivu-mawi force-pushed the epoll-keepalive-extended-params-master branch from b400750 to 757c83f Compare May 18, 2026 12:50
@ivu-mawi
Copy link
Copy Markdown
Author

Fixed unit tests by disallowing 0 as value again

@vietj vietj force-pushed the epoll-keepalive-extended-params-master branch from 1ab7c76 to caa0f8c Compare May 20, 2026 08:11
@ivu-mawi
Copy link
Copy Markdown
Author

ivu-mawi commented May 20, 2026

One thing I'm not sure about with the new TcpOption is we're setting various parameters to -1 explicitly now, even though the intention in some of the code seems to have been that -1 means "don't set the option on the actual socket, leave whatever the OS default is". I couldn't find any docs as to whether setting these options to -1 explicitly is allowed or breaks something.

@ivu-mawi
Copy link
Copy Markdown
Author

Oh, it looks like exactly that is actually causing an error in the pipeline runs.

… option to something < 1, since this is at best useless and at worst leads to an error.
@ivu-mawi
Copy link
Copy Markdown
Author

We can see here that Linux does not allow any value < 1.

I have made it so that 0 instead of -1 is now the special value that means "do not set, leave OS-default". This is technically incompatible to the code from vert.x 4.x, but I'd say that's okay. Probably very few people will explicitly use -1, and if they do, they will get a runtime exception after upgrading to vert.x 5, and have to change it to 0.

I've done that just because it's nicer to have a isNullOrZero method than a isNullOrMinusOne method ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants