RFR [9] 8154017: Shutdown hooks are racing against shutdown sequence, if System.exit()-calling thread is interrupted

David Holmes david.holmes at oracle.com
Thu Jun 23 21:23:27 UTC 2016

Looks good.

I would probably have had the hook interrupt the main thread while it 
was running ie sleep(5000); main.interrupt(); sleep(5000); but 
pre-interrupting itself before calling exit is probably functionally 


On 24/06/2016 2:32 AM, Chris Hegarty wrote:
> The shutdown hooks race against the shutdown sequence if the thread
> invoking System.exit() is interrupted.  This happens because
> ApplicationShutdownHooks::runHooks joins the shutdown hooks. This
> may lead to premature VM shutdown, with shutdown hooks not fully
> executed.
> http://cr.openjdk.java.net/~chegar/8154017/
> https://bugs.openjdk.java.net/browse/JDK-8154017
> -Chris.

More information about the core-libs-dev mailing list