Nomad: raw_exec process children aren't kill properly

Created on 15 Dec 2016  路  6Comments  路  Source: hashicorp/nomad

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.

themdriveraw_exec themplatform-windows typenhancement

Most helpful comment

@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.

All 6 comments

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

Is not the situation identical to https://github.com/hashicorp/nomad/issues/1110: "Raw_exec does not shut down child processes on nomad stop"?

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).

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.

@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.

Any news on this topic ?
Thanks

Was this page helpful?
0 / 5 - 0 ratings