Repository: quarkusio/quarkus
Issue: vertx event look thread blocked Warning messages

**Describe the bug**
Pretty much every time I build projects from quickstart, or running some runner jars throws WARNING messages that vertx event loop is blocked as below
```
2019-08-23 11:22:21,441 WARNING [io.ver.cor.imp.BlockedThreadChecker] (vertx-blocked-thread-checker) Thread Thread[vert.x-eventloop-thread-4,5,main]=Thread[vert.x-eventloop-thread-4,5,main] has been blocked for 3916 ms, time limit is 2000 ms: io.vertx.core.VertxException: Thread blocked
        at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
        at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:929)
        at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1324)
        at java.net.InetAddress.getLocalHost(InetAddress.java:1501)
        at sun.management.VMManagementImpl.getVmId(VMManagementImpl.java:140)
        at sun.management.RuntimeImpl.getName(RuntimeImpl.java:59)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at io.netty.channel.DefaultChannelId.defaultProcessId(DefaultChannelId.java:120)
        at io.netty.channel.DefaultChannelId.<clinit>(DefaultChannelId.java:77)
        at io.netty.channel.AbstractChannel.newId(AbstractChannel.java:112)
        at io.netty.channel.AbstractChannel.<init>(AbstractChannel.java:84)
        at io.netty.channel.nio.AbstractNioChannel.<init>(AbstractNioChannel.java:84)
        at io.netty.channel.nio.AbstractNioMessageChannel.<init>(AbstractNioMessageChannel.java:42)
        at io.netty.channel.socket.nio.NioServerSocketChannel.<init>(NioServerSocketChannel.java:88)
        at io.netty.channel.socket.nio.NioServerSocketChannel.<init>(NioServerSocketChannel.java:74)
        at io.vertx.core.net.impl.transport.Transport$$Lambda$235/888928066.newChannel(Unknown Source)
        at io.netty.bootstrap.AbstractBootstrap.initAndRegister(AbstractBootstrap.java:320)
        at io.netty.bootstrap.AbstractBootstrap.doBind(AbstractBootstrap.java:282)
        at io.netty.bootstrap.AbstractBootstrap.bind(AbstractBootstrap.java:278)
        at io.vertx.core.net.impl.AsyncResolveConnectHelper.lambda$doBind$3(AsyncResolveConnectHelper.java:86)
        at io.vertx.core.net.impl.AsyncResolveConnectHelper$$Lambda$236/986266054.handle(Unknown Source)
        at io.vertx.core.impl.AddressResolver.lambda$null$0(AddressResolver.java:88)
        at io.vertx.core.impl.AddressResolver$$Lambda$238/922142897.handle(Unknown Source)
        at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:369)
        at io.vertx.core.impl.EventLoopContext.lambda$executeAsync$0(EventLoopContext.java:38)
        at io.vertx.core.impl.EventLoopContext$$Lambda$228/259319861.run(Unknown Source)
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:495)
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:905)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.lang.Thread.run(Thread.java:748)

2019-08-23 11:22:22,589 INFO  [io.quarkus] (main) Quarkus 999-SNAPSHOT started in 16.301s. Listening on: http://0.0.0.0:8080
```

**Expected behavior**
No warning

**Actual behavior**
Warning message about event loop blocked

**To Reproduce**
I build integration test of dynamodb module (see PR #3172)
1. Just build `mvn clean install` the `integration-tests/amazon-dynamodb`
2. Run the runner `java -jar target/quarkus-integration-test-amazon-dynamodb-999-SNAPSHOT-runner.jar`

I'm experiencing the same issue when running any integration tests.

**Configuration**
N/A

**Screenshots**
(If applicable, add screenshots to help explain your problem.)

**Environment (please complete the following information):**
 - Output of `uname -a` or `ver`: `Darwin PL-MAC.local 18.7.0 Darwin Kernel Version 18.7.0: Thu Jun 20 18:42:21 PDT 2019; root:xnu-4903.270.47~4/RELEASE_X86_64 x86_64`
 - Output of `java -version`: 
```
java version "1.8.0_192"
Java(TM) SE Runtime Environment (build 1.8.0_192-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.192-b12, mixed mode)
```
 - GraalVM version (if different from Java): 
```
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-20190711112007.graal.jdk8u-src-tar-gz-b08)
OpenJDK 64-Bit GraalVM CE 19.1.1 (build 25.222-b08-jvmci-19.1-b01, mixed mode)
```
 - Quarkus version or git rev: `SNAPSHOT`, e.g. #3172

**Additional context**
(Add any other context about the problem here.)


Changed files:
extensions/netty/deployment/src/main/java/io/quarkus/netty/deployment/NettyProcessor.java
extensions/netty/runtime/src/main/java/io/quarkus/netty/runtime/NettyRecorder.java

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 33946a8b60c..99bcdc4d5e4 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
@@ -96,6 +96,15 @@ SubstrateConfigBuildItem build(BuildProducer<JniBuildItem> jni) {
                 .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();
+    }
+
     @BuildStep
     @Record(ExecutionTime.STATIC_INIT)
     void createExecutors(BuildProducer<RuntimeBeanBuildItem> runtimeBeanBuildItemBuildProducer,
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 e9bb23f3f44..f75f2de6b1b 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,6 +2,9 @@
 
 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;
@@ -9,6 +12,25 @@
 @Recorder
 public class NettyRecorder {
 
+    private static final Logger log = Logger.getLogger(NettyRecorder.class);
+
+    public void eagerlyInitChannelId() {
+        //this class is slow to init and can block the IO thread and cause a warning
+        //we init it from a throway 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(
+                            "Localhost lookup took more than one second, you need to add a /etc/hosts entry to improve Quarkus startup time. See https://thoeni.io/post/macos-sierra-java/ for details.");
+                }
+            }
+        }).start();
+    }
+
     public Supplier<Object> createEventLoop(int nThreads) {
         return new Supplier<Object>() {