Skip to content

Commit 98c93b7

Browse files
committed
Fix due to netty/netty#15922
1 parent 2ef1a7e commit 98c93b7

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

core/src/main/java/io/netty/loom/EventLoopScheduler.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,12 @@ public EventLoopScheduler(IoEventLoopGroup parent, ThreadFactory threadFactory,
8383
eventLoopThread = vThreadFactory
8484
.newThread(() -> FastThreadLocalThread.runWithFastThreadLocal(this::nettyEventLoop));
8585
ioEventLoop = new ManualIoEventLoop(parent, eventLoopThread,
86-
ioExecutor -> new AwakeAwareIoHandler(eventLoopIsRunning, ioHandlerFactory.newHandler(ioExecutor)));
86+
ioExecutor -> new AwakeAwareIoHandler(eventLoopIsRunning, ioHandlerFactory.newHandler(ioExecutor))) {
87+
@Override
88+
public boolean canBlock() {
89+
return runQueue.isEmpty();
90+
}
91+
};
8792
carrierThread.start();
8893
}
8994

core/src/test/java/io/netty/loom/VirtualMultithreadIoEventLoopGroupTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.util.stream.Stream;
2222

2323
import io.netty.channel.*;
24+
import io.netty.channel.epoll.Epoll;
2425
import io.netty.channel.local.LocalIoHandler;
2526
import io.netty.channel.epoll.EpollIoHandler;
2627
import io.netty.channel.epoll.EpollServerSocketChannel;
@@ -63,8 +64,7 @@ boolean isLocal() {
6364
boolean isAvailable() {
6465
return switch (this) {
6566
case NIO -> true;
66-
// TODO disable EPOLL due to https://github.com/netty/netty/issues/15922
67-
case EPOLL -> false;
67+
case EPOLL -> Epoll.isAvailable();
6868
case IO_URING -> IoUring.isAvailable();
6969
case LOCAL -> true;
7070
default -> false;

0 commit comments

Comments
 (0)