-
Notifications
You must be signed in to change notification settings - Fork 712
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
Process does not terminate after calling System.exit in daemon thread #10255
Comments
@gacholio fyi If I run Launchee on Linux with a recent build, it hangs, needs to be killed with -9. |
I can see what's wrong, but I'll need some time to think about how to fix it. |
Here's the hang scenario:
|
The solution appears to be moving the "indicate exit started" to after the call to Shutdown.shutdown(). This still protects against multiple VMDeath events and exit during VMDeath. |
Don't indicate exit until after calling Shutdown.shutDown() in DestroyJavaVM. See issue for details. Fixes: eclipse-openj9#10255 [ci skip] Signed-off-by: Graham Chapman <graham_chapman@ca.ibm.com>
Thank you for the quick fix. I did not quite follow the comment that CountDownLatch does not exist in Java 8 (it was introduced with Java 5). https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/CountDownLatch.html |
OK, my mistake - I had never seen it used until very recently, so I assumed it was new. |
There seems to be a regression introduced with 0.21 that results in process not terminating after user code calls System.exit in a daemon thread.
Probably related to:
#9516
#9558
I can reproduce this with the following code:
This sometimes hangs when executed with AdoptOpenJDK OpenJ9 8.0.262.10. Similar problem was observed with 11.0.8.10.0 and 14.0.2.12.0.
I simply launched this in a loop:
With Hotspot and previous JVMs I get
With OpenJ9 0.21 I sometimes just get:
and then it hangs forever.
The text was updated successfully, but these errors were encountered: