-
Notifications
You must be signed in to change notification settings - Fork 54
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
Shutdown Hooks Not Running #20
Comments
We only have very coarse control over the spawned process. To stop it we use Process.destroy which I guess is equivalent to The first thing to do proper shutdown would be a platform independent way to signal a termination wish to a process. Do you know if there's a Java library doing this? (like using |
Another possibility would be to allow a user-defined way of closing an application and leave the current force-close behavior as default or fallback. |
I have this problem as well. Shutdown is not handled correctly and then a new process is spawned but fails because it can't bind to the port that is taken. I have to shut down SBT every time I want to restart. My setup is a multi project setup. Even when I try to run re-stop it doesn't shut down the processes correctly. |
Magnus, this sounds like quite the opposite problem: where the original issue was about the process being closed to eagerly so that the shutdown hooks are not run, what you are experiencing seems to be that |
You're correct. I found that my issue was better described in the other bug and that fix seems to have made the trick for my issue. Thank you. |
Closing... |
Maybe we can let this issue opened, as it is present. We could try a proper shutdown, then wait a bit and then kill the process if it's still there.
|
Please open a new ticket if you have a concrete idea how to fix this. As written above, the current behavior is currently equivalent to |
I don't this problem on UNIX/OSX because I do have this problem on Windows. |
@dwickern that's interesting, since that behavior seems to have changed for Unix only with Java 8. Since then there are two methods That said, it seems you are also right about Windows. Should we keep that open as a reminder that it still doesn't work on Windows? |
My configuration is fairly simple, but at startup I add a shutdown hook:
Runtime.getRuntime.addShutdownHook(...)
However, at re-stop (or ~re-start code change) the hook is never fired. The documentation explicitly states this is how shutdown should be handled. Is there additional configuration I need to specify to make those hooks fire?
The text was updated successfully, but these errors were encountered: