-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Make shutdown cause/trigger available #16976
Comments
That's not a bad idea, we could add some information into the event, but I have no clue when it comes to determining the cause of shutdown. Looking at Quarkus code, we have @geoand any idea how/if we could achieve that? |
It's actually pretty easy in Quarkus code to determine whether or not the shutdown came from a Ultimately |
@xtaixe What exactly do you consider a "normal" exit for CLI app? I.e how do you quit the app in a normal way?
@geoand I saw |
It's only invoked when the shutdown comes from a SIGINT, not from a normal program termination or application code initiated termination. |
Maybe I didn't express that properly. I meant the program just finishes cause there's nothing more to do (e.g.
Maybe it's not worth distinguishing. In our case it's not needed, as long we can distinguish finishing from interrupted is enough. But if the information is already there maybe just provide it and let the user decide. |
Right, we can only probably differentiate between normal program finish and "all else". I'll try to get to it later this week and put together a PR. |
Description
CLI apps might need to know if shutdown is due to normal exit or due to Ctrl+C/SIGINT, so there should be a way to distinguish those (and maybe other signals too).
Implementation ideas
Enhance the
ShutdownEvent
with some kind of "cause" or "trigger" property or maybe have different events to observe for different shutdown triggers.The text was updated successfully, but these errors were encountered: