I set a breakpoint in the shutdown hook, and debug it in intellij. But it looks like it has some timeout that it would automatically exit after some time.
Shutdown hook exits automatically when debugging it
196 views Asked by zjffdu At
1
I set a breakpoint in the shutdown hook, and debug it in intellij. But it looks like it has some timeout that it would automatically exit after some time.
In cases of System Shutdown, operating system allows a fixed amount of time for shutdown and exit. In other cases application waits for shutdown-hook to complete like
ctrl C
,System.exit(status)
It is expected that shutdown-hook to finish their work quickly.