Not sure if this is an issue or a known limitation, anyway here's a problem I found while testing Vert.x core main branch with io_uring (Netty 4.2.12.Final)
We had some test failures in our QuickServerTest and Http3ServerTest close/shutdown tests because not all clients received a notification of connection being closed by the server.
The failure goes away by deferring UDP channel close in Vert.x io.vertx.core.net.impl.quic.QuicEndpointImpl:
this.connectionGroup = new ConnectionGroup(channel.eventLoop()) {
@Override
protected void handleClose(Completable<Void> completion) {
Channel ch = channel;
// Defer close to allow io_uring (if used) to complete pending SENDMSG for CONNECTION_CLOSE
ch.eventLoop().schedule(() -> {
ch.close().addListener((ChannelFutureListener) future -> {
synchronized (QuicEndpointImpl.this) {
context = null;
}
}).addListener((ChannelFutureListener) future -> {
try {
closeHook();
} finally {
completion.succeed();
}
});
}, 0, TimeUnit.MILLISECONDS);
}
};
I think the issue is that flush() and close() are called on the datagram channel within the same event loop iteration, so the SENDMSG SQE submitted by flush() is cancelled by close() before the kernel processes it.
Not sure if this is an issue or a known limitation, anyway here's a problem I found while testing Vert.x core main branch with io_uring (Netty
4.2.12.Final)We had some test failures in our QuickServerTest and Http3ServerTest close/shutdown tests because not all clients received a notification of connection being closed by the server.
The failure goes away by deferring UDP channel close in Vert.x
io.vertx.core.net.impl.quic.QuicEndpointImpl:I think the issue is that
flush()andclose()are called on the datagram channel within the same event loop iteration, so the SENDMSG SQE submitted byflush()is cancelled byclose()before the kernel processes it.