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 8394b10946..d9ac209f96 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 @@ -674,9 +674,9 @@ abstract class AbstractIOUringChannel extends AbstractChannel implements UnixCha @Override public void run() { ChannelPromise connectPromise = AbstractIOUringChannel.this.connectPromise; - ConnectTimeoutException cause = - new ConnectTimeoutException("connection timed out: " + remoteAddress); - if (connectPromise != null && connectPromise.tryFailure(cause)) { + if (connectPromise != null && !connectPromise.isDone() && + connectPromise.tryFailure(new ConnectTimeoutException( + "connection timed out: " + remoteAddress))) { close(voidPromise()); } }