Shutdown hook exits automatically when debugging it

173 views Asked by At

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.

1

There are 1 answers

0
ravthiru On

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.