eclipse-vertx / vert.x

Vert.x is a tool-kit for building reactive applications on the JVM
http://vertx.io
Other
14.32k stars 2.08k forks source link

Used VM option to config vert.x deployment option, But setter invoke method is Unreachable. #5301

Open EasonLyo opened 2 months ago

EasonLyo commented 2 months ago

Questions I used -Dvertx.deployment.options.threadingModel=VIRTUAL_THREAD to config vert.x deployment option, when i debug it, I found some code is Unreachable.

Version 4.5.9

Context In io.vertx.core.impl.launcher.commands.BareCommand#configureFromSystemProperties method ,when the param 'prefix' value is 'vertx.deployment.options.', but log is null, thats why vertx options setter invoke not execute. after this, I found in io.vertx.core.impl.launcher.commands.BareCommand#startVertx method line 226, the code 'configureFromSystemProperties.set(null);' make log is null.

the chain is : io.vertx.core.impl.launcher.VertxCommandLauncher#execute io.vertx.core.impl.launcher.commands.RunCommand#run io.vertx.core.impl.launcher.commands.BareCommand#run(java.lang.Runnable) io.vertx.core.impl.launcher.commands.BareCommand#startVertx and in BareCommand line 226 code 'configureFromSystemProperties.set(null);'

Do you have a reproducer? This is easy to reproducer

Steps to reproduce config -Dvertx.deployment.options.threadingModel=VIRTUAL_THREAD VM option use launcher to deploy, like new Launcher().dispatch(args) debug reproduce Extra OS: Apple M1 Pro ventura 13.6 JDK: java version "21.0.4" 2024-07-16 LTS

finally, I used beforeDeployingVerticle() method in Launcher class to resolve my problem by hook deployment options, but Im still think this is a bug...

if i do it in wrong way, reply and close this issue plz.

vietj commented 2 months ago

did you check https://repo1.maven.org/maven2/io/vertx/vertx-core/4.5.10/vertx-core-4.5.10-native-image.jar ?

tsegismont commented 2 months ago

@EasonLyo can you please prepare a small reproducer and share it on GitHub? Thank you

EasonLyo commented 1 month ago

https://github.com/EasonLyo/reproducer-vertx-core, this is a small reproducer, it have some note in class MainLaucher.

tsegismont commented 1 month ago

Thanks, I'll take a look