Skip to content

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

Open
tachiniererin wants to merge 1 commit into
markbates:masterfrom
tachiniererin:master
Open

Send SIGTERM to give the process a chance to clean up#44
tachiniererin wants to merge 1 commit into
markbates:masterfrom
tachiniererin:master

Conversation

@tachiniererin

Copy link
Copy Markdown

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