Skip to content

Conversation

@dreamlike-ocean
Copy link

Motivation:

Enable the io_uring UDS and sendfile implementations

Current Netty io_uring transport already fully provides sendfile and Unix domain socket functionality. This PR enables Vert.x support for these features.
1. io.vertx.core.impl.transports.IoUringTransport#supportsDomainSockets will always return true, and io.vertx.core.impl.transports.IoUringTransport#configure(io.vertx.core.net.TcpOptions, boolean, io.netty.bootstrap.ServerBootstrap) and io.vertx.core.impl.transports.IoUringTransport#configure(io.vertx.core.net.TcpOptions, boolean, io.netty.bootstrap.Bootstrap) are adjusted to support Unix domain sockets.
2. io.vertx.core.impl.transports.IoUringTransport#supportFileRegion: if the current Linux kernel supports IORING_OP_SPLICE and it is not disabled by system parameters, sendfile support is enabled.
3. Due to performance issues with io_uring splice (see netty/netty#15747), support is added to forcibly disable io_uring sendfile via a system parameter.
4. Introduce UncloseableFileRegion to replace the current DefaultFileRegion in Vert.x code, preventing resource leaks caused by non-zero reference counts. fix #5743

Conformance:

I have signed the Eclipse Contributor Agreement

@dreamlike-ocean
Copy link
Author

Additionally, regarding advanced features supported by Netty io_uring such as BufferGroup read and sendzc, I believe users can implement them manually, for example, in the following way.
https://gist.github.com/dreamlike-ocean/38d8e62c043018f1ab4dd872414a0b33

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.

Zero copy file transferring (via FileRegion) is disabled for IoUring transport.

1 participant