From 044ec159b91ac70a8b8699727c12aeb9733ab6ef Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Wed, 9 Sep 2020 11:43:46 +0200 Subject: [PATCH] Only schedule another read if the FD is still open (#10551) Motivation: We should only keep on reading if the fd is still open, otherwise we will produce a confusing exception Modifications: check if fd is still open before schedule the read. Result: Dont produce a confusing excepion when the fd was closed during a read loop. --- .../java/io/netty/channel/uring/AbstractIOUringChannel.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/transport-native-io_uring/src/main/java/io/netty/channel/uring/AbstractIOUringChannel.java b/transport-native-io_uring/src/main/java/io/netty/channel/uring/AbstractIOUringChannel.java index aa818046e8..4bad1e8c79 100644 --- a/transport-native-io_uring/src/main/java/io/netty/channel/uring/AbstractIOUringChannel.java +++ b/transport-native-io_uring/src/main/java/io/netty/channel/uring/AbstractIOUringChannel.java @@ -520,7 +520,8 @@ abstract class AbstractIOUringChannel extends AbstractChannel implements UnixCha } protected final void scheduleRead() { - if (delayedClose == null) { + // Only schedule another read if the fd is still open. + if (delayedClose == null && fd().isOpen()) { ioState |= READ_SCHEDULED; scheduleRead0(); }