diff --git a/client/driver/executor/executor.go b/client/driver/executor/executor.go index 8db847ad5..aba0ee8b4 100644 --- a/client/driver/executor/executor.go +++ b/client/driver/executor/executor.go @@ -120,7 +120,7 @@ type ExecCommand struct { ResourceLimits bool // Cgroup marks whether we put the process in a cgroup. Setting this field - // doesn't enforce resource limits. To enforce limits, set ResoruceLimits. + // doesn't enforce resource limits. To enforce limits, set ResourceLimits. // Using the cgroup does allow more precise cleanup of processes. BasicProcessCgroup bool } diff --git a/client/driver/raw_exec_test.go b/client/driver/raw_exec_test.go index 4446db8d9..42f6d47ae 100644 --- a/client/driver/raw_exec_test.go +++ b/client/driver/raw_exec_test.go @@ -265,6 +265,9 @@ func TestRawExecDriver_Start_Kill_Wait(t *testing.T) { } } +// This test creates a process tree such that without cgroups tracking the +// processes cleanup of the children would not be possible. Thus the test +// asserts that the processes get killed properly when using cgroups. func TestRawExecDriver_Start_Kill_Wait_Cgroup(t *testing.T) { tu.ExecCompatible(t) t.Parallel() diff --git a/website/source/docs/drivers/raw_exec.html.md b/website/source/docs/drivers/raw_exec.html.md index 0ec6c2a35..1d01bd90b 100644 --- a/website/source/docs/drivers/raw_exec.html.md +++ b/website/source/docs/drivers/raw_exec.html.md @@ -109,3 +109,10 @@ The `raw_exec` driver will set the following client attributes: ## Resource Isolation The `raw_exec` driver provides no isolation. + +If the launched process creates a new process group, it is possible that Nomad +will leak processes on shutdown unless the application forwards signals +properly. Nomad will not leak any processes if cgroups are being used to manage +the process tree. Cgroups are used on Linux when Nomad is being run with +appropriate priviledges, the cgroup system is mounted and the operator hasn't +disabled cgroups for the driver.