-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Change SIGINT to SIGTERM #29
Conversation
@@ -113,7 +115,7 @@ func (h *execHandle) Update(task *structs.Task) error { | |||
// Kill is used to terminate the task. We send an Interrupt | |||
// and then provide a 5 second grace period before doing a Kill. | |||
func (h *execHandle) Kill() error { | |||
h.proc.Signal(os.Interrupt) | |||
h.proc.Signal(unix.SIGTERM) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not just use the constants in syscall
here? syscall.SIGTERM
seems like it could help us avoid the extra import.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The syscall
docs say this:
NOTE: This package is locked down. Code outside the standard Go repository should be migrated to use the corresponding package in the golang.org/x/sys repository.
I'd probably use a build tag file |
After digging further, the go signal implementation for windows doesn't handle signals at all. They all result in an error state. We don't check errors from the signal call so all this means for windows is we wait 5 seconds and then kill the process. TL;DR this change makes POSIX systems use SIGTERM, and Windows is completely unaffected. |
Update StableStore documentation based on hashicorp#29
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
The docs casually mention that
os.Interrupt
doesn't do anything on Windows, so I'm curious whetherproc.Signal
does anything at all on Windows or is silently ignored.unix.SIGTERM
should work on any POSIX OS.Closes #27