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

Send SIGTERM to give the process a chance to clean up #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tachiniererin
Copy link

Killing the process doesn't let any defer handlers to be run. SIGTERM is a bit of a nicer approach, while still signalling the process it absolutely has to terminate, it gives a chance to clean up first.

With the most recent Go version, SIGINT should also work according to https://golang.org/pkg/os/signal/#hdr-Windows and it is also tested https://golang.org/src/os/signal/signal_windows_test.go.

Still, I propose to use SIGTERM, as it conveys the meaning better in this case, and is more portable (no extra code-paths on Windows).

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

Successfully merging this pull request may close these issues.

1 participant