Skip to content
This repository was archived by the owner on Apr 3, 2025. It is now read-only.

Commit da7e4b2

Browse files
authored
Fix SubmissionQueue.addTimeout(...) (#264)
Motivation: We did not correctly fill the submission entry for IORING_OP_TIMEOUT which could lead to timeouts firing to early. We need to use a count of 1 when submitting these as we want to notify once either there is one completion ready to process or when the timeout elapsed. Modifications: Correctly fill submission entry Result: IoUringEventLoop.run() will block for the correct amount of time. This is a port of netty/netty#14712
1 parent 2e4a4d3 commit da7e4b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

transport-classes-io_uring/src/main/java/io/netty/incubator/channel/uring/IOUringSubmissionQueue.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ private void setData(long sqe, byte op, int flags, int rwFlags, int fd, long buf
152152

153153
boolean addTimeout(long nanoSeconds, short extraData) {
154154
setTimeout(nanoSeconds);
155-
return enqueueSqe(Native.IORING_OP_TIMEOUT, 0, 0, -1, timeoutMemoryAddress, 1, 0, extraData);
155+
return enqueueSqe(Native.IORING_OP_TIMEOUT, 0, 0, -1, timeoutMemoryAddress, 1, 1, extraData);
156156
}
157157

158158
boolean removeTimeout(short extraData) {

0 commit comments

Comments
 (0)