From ccd5a6e411962b7441000d0aa7e0a8be14298c3b Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Sat, 5 Sep 2020 10:22:02 +0200 Subject: [PATCH] Add workaround for current kernel bug related to WRITEV and IOSEQ_ASYNC Motivation: There is currently a bug in the kernel that let WRITEV sometimes fail when IOSEQ_ASYNC is enabled Modifications: Don't use IOSEQ_ASYNC for WRITEV for now Result: Tests pass --- .../java/io/netty/channel/uring/IOUringSubmissionQueue.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/transport-native-io_uring/src/main/java/io/netty/channel/uring/IOUringSubmissionQueue.java b/transport-native-io_uring/src/main/java/io/netty/channel/uring/IOUringSubmissionQueue.java index f7d66c8360..43717ea22d 100644 --- a/transport-native-io_uring/src/main/java/io/netty/channel/uring/IOUringSubmissionQueue.java +++ b/transport-native-io_uring/src/main/java/io/netty/channel/uring/IOUringSubmissionQueue.java @@ -137,7 +137,10 @@ final class IOUringSubmissionQueue { } // TODO: Make it configurable if we should use this flag or not. - PlatformDependent.putByte(sqe + SQE_FLAGS_FIELD, (byte) Native.IOSQE_ASYNC); + PlatformDependent.putByte(sqe + SQE_FLAGS_FIELD, + // Workaround for a kernel bug: + // See https://lore.kernel.org/io-uring/6428c1ee0234105d18c5e3e88aa00c57@nickhill.org/T/#t + (byte) (op != Native.IORING_OP_WRITEV ? Native.IOSQE_ASYNC : 0)); // pad field array -> all fields should be zero long offsetIndex = 0;