-
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
B 2117 windows group process #4153
B 2117 windows group process #4153
Conversation
- Set CREATE_NEW_PROCESS_GROUP for Windows subprocess. - Ensure we only kill actual process that need to.
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.
This looks great! Is there a job file you've been using to test this? I'd love to give it a spin myself before merging.
Thanks for the PR!
@@ -3,6 +3,9 @@ | |||
IMPROVEMENTS: | |||
* client: Create new process group on process startup. [[GH-3572](https://github.com/hashicorp/nomad/issues/3572)] | |||
|
|||
BUG FIXES: | |||
* driver/exec: Create process group for Windows process and send Ctrl-Break signal on Shutdown [[GH-2117](https://github.com/hashicorp/nomad/issues/2117)] |
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.
We use the pull request number instead of the issue number for these links. The issues
in the URL is just a typo we haven't fixed in our make changelogfmt
script because Github is nice enough to redirect it anyway. :)
|
||
// configure new process group for child process | ||
func (e *UniversalExecutor) setNewProcessGroup() error { | ||
// We need to check that as build flags includes windows for this file |
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.
Remove this comment
"github.com/hashicorp/nomad/client/driver/logging" | ||
) | ||
|
||
func (e *UniversalExecutor) LaunchSyslogServer() (*SyslogServerState, error) { |
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.
Like you pointed out in the issue description I don't think there was any reason for this to be in the executor_unix.go
file instead of executor.go
proper. Would you mind moving it there to avoid duplication?
return err | ||
} | ||
return nil | ||
} else { |
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.
Remove else statement and just fall through to proc.Kill()
} | ||
} | ||
|
||
func (e *UniversalExecutor) shutdownProcess(proc *os.Process) error { |
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.
Comment that this sends the shutdown signal and doesn't necessarily kill the process
@@ -0,0 +1,111 @@ | |||
// +build windows |
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.
Unnecessary since the file has _windows.go
* `driver/raw_exec` instead of `exec` because `exec` driver isn't supported on Windows * Link to PR not issue
* `driver/raw_exec` instead of `exec` because `exec` driver isn't supported on Windows * Link to PR not issue
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. |
This PR is a best attempt to resolve #2117. Windows processes never cleanly map to Posix semantic so there is a couple of issues here: