quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.82k stars 2.69k forks source link

Vert.x + listening to a Unix Domain Socket doesn't work in native #25928

Open rsvoboda opened 2 years ago

rsvoboda commented 2 years ago

Describe the bug

Vert.x ++ listening to a Unix Domain Socket doesn't work in native

JVM mode works, but Native mode doesn't.

target/code-with-quarkus-1.0.0-SNAPSHOT-runner  
__  ____  __  _____   ___  __ ____  ______
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
2022-06-02 13:29:27,967 ERROR [io.qua.run.Application] (main) Failed to start application (with profile prod): java.lang.IllegalArgumentException
    at io.vertx.core.net.impl.transport.Transport.serverChannelFactory(Transport.java:194)
    at io.vertx.core.net.impl.AsyncResolveConnectHelper.doBind(AsyncResolveConnectHelper.java:37)
    at io.vertx.core.net.impl.TCPServerBase.listen(TCPServerBase.java:169)
    at io.vertx.core.net.impl.TCPServerBase.bind(TCPServerBase.java:100)
    at io.vertx.core.http.impl.HttpServerImpl.listen(HttpServerImpl.java:217)
    at io.vertx.core.http.impl.HttpServerImpl.listen(HttpServerImpl.java:230)
    at io.quarkus.vertx.http.runtime.VertxHttpRecorder$WebDeploymentVerticle.setupUnixDomainSocketHttpServer(VertxHttpRecorder.java:1121)
    at io.quarkus.vertx.http.runtime.VertxHttpRecorder$WebDeploymentVerticle.start(VertxHttpRecorder.java:1108)
    at io.vertx.core.impl.DeploymentManager.lambda$doDeploy$5(DeploymentManager.java:196)
    at io.vertx.core.impl.AbstractContext.dispatch(AbstractContext.java:100)
    at io.vertx.core.impl.AbstractContext.dispatch(AbstractContext.java:63)
    at io.vertx.core.impl.EventLoopContext.lambda$runOnContext$0(EventLoopContext.java:38)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:503)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.lang.Thread.run(Thread.java:829)
    at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:596)
    at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:192)

As if the netty-transport artifacts were not included in the native image.

Expected behavior

Vert.x ++ listening to a Unix Domain Socket works OOTB in native

Actual behavior

Vert.x ++ listening to a Unix Domain Socket doesn't work in native

How to Reproduce?

JVM mode works:

mvn clean package -DskipTests
java -jar target/quarkus-app/quarkus-run.jar

Native mode fails

mvn clean package -DskipTests -Dnative
target/code-with-quarkus-1.0.0-SNAPSHOT-runner

Output of uname -a or ver

macOS Monterey

Output of java -version

Java 17

GraalVM version (if different from Java)

GraalVM 22.0 Java17

Quarkus version or git rev

2.9.2.Final

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

rsvoboda commented 2 years ago

@cescoffier When asking about Are you trying domain sockets in native? in https://github.com/quarkusio/quarkus/issues/26082#issuecomment-1153745983 issue, I guess you wanted to highlight this issues. (cc @pjgg)

cescoffier commented 2 years ago

It is expected that it does not work. I have tried a few times without success. I need to find a long interrupted time to do that (basically PTO)