Skip to content
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

Graceful shutdown for running process #11

Open
GeertJohan opened this issue Sep 29, 2013 · 3 comments
Open

Graceful shutdown for running process #11

GeertJohan opened this issue Sep 29, 2013 · 3 comments

Comments

@GeertJohan
Copy link
Contributor

I'm now using rerun for an application that performs graceful shutdown on the interrupt signal.
Rerun kill's the process directly, without any grace.
Happens here: https://github.com/skelterjohn/rerun/blob/master/rerun.go#L91

I think it would be good to have rerun send os.Interrupt to the application that is running. The go runtime will kill itself unless signal.Notify(..) was called for the os.Interrupt signal. We could add a timeout and do proc.Kill anyway when the graceful shutdown is taking too long. On the other hand, how to define "too long"? I think if a graceful shutdown should be able to take it's time. When the application just doesn't do a graceful shutdown on signal os.Interrupt, it has a bug that should be asap fixed by the dev. Thoughts?

@GeertJohan
Copy link
Contributor Author

Whoops, I said kill where I meant interrupt. Edited issue.

@GeertJohan
Copy link
Contributor Author

One could argue to use SIGTERM, instead of os.Interrupt (SIGINT). However, SIGTERM is not abstracted by Go's os package. I think it isn't cross-platform supported....
afaik: os.Interrupt is.

@GeertJohan
Copy link
Contributor Author

What are your thoughts on SIGINT vs SIGTERM? @skelterjohn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant