vert-x3 / vertx-web

HTTP web applications for Vert.x
Apache License 2.0
1.11k stars 535 forks source link

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

Closed EasonLyo closed 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?

no

Steps to reproduce

  1. config -Dvertx.deployment.options.threadingModel=VIRTUAL_THREAD VM option
  2. use launcher to deploy, like new Launcher().dispatch(args)
  3. debug
  4. reproduce

Extra

OS: Apple M1 Pro ventura 13.6 JDK: java version "21.0.4" 2024-07-16 LTS

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

EasonLyo commented 2 months ago

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

tsegismont commented 2 months ago

Please report this issue to the vert.x core repo, with a small reproducer. Thanks