Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asyncDestroyOnShutdown does not work / what is it supposed to do? #168

Open
Marcono1234 opened this issue Jul 2, 2023 · 0 comments
Open

Comments

@Marcono1234
Copy link

Marcono1234 commented Jul 2, 2023

Version

0.0.8

Description

It appears asyncDestroyOnShutdown does not work correctly; the Maven JVM exits and the JavaFX window remains open.

The underlying issue is Apache Commons Exec EXEC-121: Because the JavaFX plugin uses the async execute method, the process is launched in a separate thread and the process destroyer is registered afterwards. However, in the meantime the JVM has already exited.

Also as side note, for you async execution you should probably prefer org.apache.commons.exec.DaemonExecutor over DefaultExecutor (see also EXEC-69). I assume your current code just happens to work for async JavaFX launching because Maven seems to explicitly call System.exit at the end, but that might be an implementation detail.

However, I don't really understand the use case for asyncDestroyOnShutdown. If it was working correctly (can be achieved by delaying Maven exit after JavaFX plugin execution), then what is happening is that the JavaFX application launches and then at some arbitrary point, when Maven exits, terminates. What is the use case for that / where would that be desired?
I can mainly imagine a feature like this being useful for synchronous execution, but that currently does not exist, see #169.

Reproduction steps

  1. Clone and open https://github.com/openjfx/samples/tree/master/HelloFX/Maven locally
  2. Run
    mvn clean javafx:run "-Djavafx.async=true" "-Djavafx.asyncDestroyOnShutdown=true"
    
    ❌ Bug: The Maven JVM exits but the application remains open

(Might depend a bit on the machine you are performing this on, since this is essentially a race condition, see description above)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant