From 57230be9b6fcd3f14f31db7a359c34024ca6e067 Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Mon, 8 Dec 2025 12:27:01 +0000 Subject: [PATCH] Following up on pr #9246 5 years later to cleanup --- .../netty/deployment/NettyProcessor.java | 9 ------- .../quarkus/netty/runtime/NettyRecorder.java | 26 ------------------- 2 files changed, 35 deletions(-) diff --git a/extensions/netty/deployment/src/main/java/io/quarkus/netty/deployment/NettyProcessor.java b/extensions/netty/deployment/src/main/java/io/quarkus/netty/deployment/NettyProcessor.java index 3964ff1544e80..e61743c02cdd3 100644 --- a/extensions/netty/deployment/src/main/java/io/quarkus/netty/deployment/NettyProcessor.java +++ b/extensions/netty/deployment/src/main/java/io/quarkus/netty/deployment/NettyProcessor.java @@ -302,15 +302,6 @@ NativeImageConfigBuildItem build( .build(); } - @BuildStep - @Record(ExecutionTime.RUNTIME_INIT) - public void eagerlyInitClass(NettyRecorder recorder) { - //see https://github.com/quarkusio/quarkus/issues/3663 - //this class is slow to initialize, we make sure that we do it eagerly - //before it blocks the IO thread and causes a warning - recorder.eagerlyInitChannelId(); - } - @SuppressWarnings({ "unchecked", "rawtypes" }) @BuildStep @Record(ExecutionTime.RUNTIME_INIT) diff --git a/extensions/netty/runtime/src/main/java/io/quarkus/netty/runtime/NettyRecorder.java b/extensions/netty/runtime/src/main/java/io/quarkus/netty/runtime/NettyRecorder.java index 381bf2d8937e9..00e844acb2297 100644 --- a/extensions/netty/runtime/src/main/java/io/quarkus/netty/runtime/NettyRecorder.java +++ b/extensions/netty/runtime/src/main/java/io/quarkus/netty/runtime/NettyRecorder.java @@ -2,9 +2,6 @@ import java.util.function.Supplier; -import org.jboss.logging.Logger; - -import io.netty.channel.DefaultChannelId; import io.netty.channel.EventLoopGroup; import io.netty.channel.nio.NioEventLoopGroup; import io.quarkus.runtime.annotations.Recorder; @@ -12,29 +9,6 @@ @Recorder public class NettyRecorder { - private static final Logger log = Logger.getLogger(NettyRecorder.class); - - // TODO: Remove this method (maybe in 1.6.x of Quarkus or later) if there are no user reports - // of the WARN message issued from this method. See comments in https://github.com/quarkusio/quarkus/pull/9246 - // for details - public void eagerlyInitChannelId() { - //this class is slow to init and can block the IO thread and cause a warning - //we init it from a throwaway thread to stop this - //we do it from another thread so as not to affect start time - new Thread(new Runnable() { - @Override - public void run() { - long start = System.currentTimeMillis(); - DefaultChannelId.newInstance(); - if (System.currentTimeMillis() - start > 1000) { - log.warn("Netty DefaultChannelId initialization (with io.netty.machineId" + - " system property set to " + System.getProperty("io.netty.machineId") - + ") took more than a second"); - } - } - }).start(); - } - public Supplier createEventLoop(int nThreads) { return new Supplier() {