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

raw_exec process children aren't kill properly #2117

Closed
ninoles opened this issue Dec 15, 2016 · 7 comments · Fixed by #4153
Closed

raw_exec process children aren't kill properly #2117

ninoles opened this issue Dec 15, 2016 · 7 comments · Fixed by #4153

Comments

@ninoles
Copy link
Contributor

ninoles commented Dec 15, 2016

Nomad version

Nomad v0.5.0

Operating system and Environment details

Windows 10 Pro
Nomad running in -dev mode

Issue

With raw_exec, the subprocess of the task doesn't get kill properly.
Since on Windows, os.Signal doesn't work, the executor issue a kill directly, which left no chance for the subprocess to react to it and shutdown gracefull. Preferably it should do something similar to the os/signal windows test (https://golang.org/src/os/signal/signal_windows_test.go):

  • Create the process with the new process group flag
  • Send a ctrlBreak to the process.
  • Wait for the kill timeout.
  • Kill the process if still alive.

Reproduction steps

Create a process that create a subprocess.
Run it in nomad.
Stop the process.
See that the grandchild process is still running.

@dadgar
Copy link
Contributor

dadgar commented Dec 15, 2016

Hey thanks for the great issue! We definitely want to make things better on Windows!

@dadgar dadgar added this to the v0.6.0 milestone Dec 15, 2016
@hmalphettes
Copy link
Contributor

Is not the situation identical to #1110: "Raw_exec does not shut down child processes on nomad stop"?

@ninoles
Copy link
Contributor Author

ninoles commented Jan 26, 2017

It looks similar, although the solution are probably different: #1110 seems to be related to the fact that bash doesn't seem to handle trap SIGINT properly in its case. The problem here is that, since Windows doesn't have SIGINT, nomad send a TERMINATE directly. Also, raw_exec doesn't seems to create a proper CONSOLE_GROUP under windows for handling the child process case better (not sure about this one).

@schmichael schmichael removed this from the v0.6.0 milestone Jul 31, 2017
@ninoles
Copy link
Contributor Author

ninoles commented Aug 8, 2017

Any idea if it will be in the next milestone ?
I try to implement the fix, but I need sometime to figure out the raw executor without messing with the normal exec. This will allow to run applications that start subprocess under windows, which enable to have start scripts, etc.

@dadgar
Copy link
Contributor

dadgar commented Aug 8, 2017

@ninoles Unfortunately we don't have anyone actively working on this. Over the next two releases, the implementation of the executor will change and hopefully we will be able to address this then.

@sbacquet
Copy link

Any news on this topic ?
Thanks

@github-actions
Copy link

github-actions bot commented Dec 1, 2022

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants