Add OOM detection for exec driver (#19563)

* Add OomKilled field to executor proto format

* Teach linux executor to detect and report OOMs

* Teach exec driver to propagate OOMKill information

* Fix data race

* use tail /dev/zero to create oom condition

* use new test framework

* minor tweaks to executor test

* add cl entry

* remove type conversion

---------

Co-authored-by: Marvin Chin <marvinchin@users.noreply.github.com>
Co-authored-by: Seth Hoenig <shoenig@duck.com>
This commit is contained in:
Marvin Chin
2024-01-03 23:50:27 +08:00
committed by GitHub
parent f2630add91
commit d75293d2ab
11 changed files with 202 additions and 88 deletions

3
.changelog/19563.txt Normal file
View File

@@ -0,0 +1,3 @@
```release-note:improvement
drivers/exec: Added support for OOM detection in exec driver
```

View File

@@ -43,6 +43,7 @@ var TinyChroot = map[string]string{
"/usr/bin/dash": "/bin/sh",
"/usr/bin/bash": "/bin/bash",
"/usr/bin/cat": "/bin/cat",
"/usr/bin/tail": "/bin/tail",
// destination: /usr/bin
"/usr/bin/stty": "/usr/bin/stty",

View File

@@ -552,8 +552,9 @@ func (d *Driver) handleWait(ctx context.Context, handle *taskHandle, ch chan *dr
}
} else {
result = &drivers.ExitResult{
ExitCode: ps.ExitCode,
Signal: ps.Signal,
ExitCode: ps.ExitCode,
Signal: ps.Signal,
OOMKilled: ps.OOMKilled,
}
}

View File

@@ -32,6 +32,7 @@ import (
"github.com/hashicorp/nomad/plugins/drivers"
dtestutil "github.com/hashicorp/nomad/plugins/drivers/testutils"
"github.com/hashicorp/nomad/testutil"
"github.com/shoenig/test/must"
"github.com/stretchr/testify/require"
)
@@ -788,6 +789,48 @@ func TestExecDriver_NoPivotRoot(t *testing.T) {
require.NoError(t, harness.DestroyTask(task.ID, true))
}
func TestExecDriver_OOMKilled(t *testing.T) {
ci.Parallel(t)
ctestutils.ExecCompatible(t)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
d := newExecDriverTest(t, ctx)
harness := dtestutil.NewDriverHarness(t, d)
allocID := uuid.Generate()
name := "oom-killed"
task := &drivers.TaskConfig{
AllocID: allocID,
ID: uuid.Generate(),
Name: name,
Resources: testResources(allocID, name),
}
task.Resources.LinuxResources.MemoryLimitBytes = 10 * 1024 * 1024
task.Resources.NomadResources.Memory.MemoryMB = 10
tc := &TaskConfig{
Command: "/bin/tail",
Args: []string{"/dev/zero"},
}
must.NoError(t, task.EncodeConcreteDriverConfig(&tc))
cleanup := harness.MkAllocDir(task, false)
defer cleanup()
handle, _, err := harness.StartTask(task)
must.NoError(t, err)
ch, err := harness.WaitTask(context.Background(), handle.Config.ID)
must.NoError(t, err)
result := <-ch
must.False(t, result.Successful(), must.Sprint("container should OOM"))
must.True(t, result.OOMKilled, must.Sprintf("got non-OOM error, code: %d, err: %v", result.ExitCode, result.Err))
t.Logf("Successfully killed by OOM killer")
must.NoError(t, harness.DestroyTask(task.ID, true))
}
func TestDriver_Config_validate(t *testing.T) {
ci.Parallel(t)
t.Run("pid/ipc", func(t *testing.T) {

View File

@@ -76,7 +76,6 @@ func (h *taskHandle) run() {
h.procState = drivers.TaskStateExited
h.exitResult.ExitCode = ps.ExitCode
h.exitResult.Signal = ps.Signal
h.exitResult.OOMKilled = ps.OOMKilled
h.completedAt = ps.Time
// TODO: detect if the task OOMed
}

View File

@@ -259,10 +259,11 @@ func (c *ExecCommand) Close() {
// ProcessState holds information about the state of a user process.
type ProcessState struct {
Pid int
ExitCode int
Signal int
Time time.Time
Pid int
ExitCode int
Signal int
OOMKilled bool
Time time.Time
}
// ExecutorVersion is the version of the executor

View File

@@ -15,6 +15,7 @@ import (
"path"
"path/filepath"
"strings"
"sync/atomic"
"syscall"
"time"
@@ -202,6 +203,23 @@ func (l *LibcontainerExecutor) Wait(ctx context.Context) (*ProcessState, error)
func (l *LibcontainerExecutor) wait() {
defer close(l.userProcExited)
// Best effort detection of OOMs. It's possible for us to miss OOM notifications in
// the event that the wait returns before we read from the OOM notification channel
var oomKilled atomic.Bool
go func() {
oomCh, err := l.container.NotifyOOM()
if err != nil {
l.logger.Error("failed to get OOM notification channel for container(%s): %v", l.id, err)
return
}
for range oomCh {
oomKilled.Store(true)
// We can terminate this goroutine as soon as we've seen the first OOM
return
}
}()
ps, err := l.userProc.Wait()
if err != nil {
// If the process has exited before we called wait an error is returned
@@ -229,10 +247,11 @@ func (l *LibcontainerExecutor) wait() {
}
l.exitState = &ProcessState{
Pid: ps.Pid(),
ExitCode: exitCode,
Signal: signal,
Time: time.Now(),
Pid: ps.Pid(),
ExitCode: exitCode,
Signal: signal,
OOMKilled: oomKilled.Load(),
Time: time.Now(),
}
}

View File

@@ -62,6 +62,7 @@ func testExecutorCommandWithChroot(t *testing.T) *testExecCmd {
"/bin/echo": "/bin/echo",
"/bin/bash": "/bin/bash",
"/bin/sleep": "/bin/sleep",
"/bin/tail": "/bin/tail",
"/foobar": "/does/not/exist",
}
@@ -267,6 +268,40 @@ passwd`
}, func(err error) { t.Error(err) })
}
func TestExecutor_OOMKilled(t *testing.T) {
ci.Parallel(t)
testutil.ExecCompatible(t)
testutil.CgroupsCompatible(t)
testExecCmd := testExecutorCommandWithChroot(t)
execCmd, allocDir := testExecCmd.command, testExecCmd.allocDir
execCmd.Cmd = "/bin/tail"
execCmd.Args = []string{"/dev/zero"}
defer allocDir.Destroy()
execCmd.ResourceLimits = true
execCmd.ModePID = "private"
execCmd.ModeIPC = "private"
execCmd.Resources.LinuxResources.MemoryLimitBytes = 10 * 1024 * 1024
execCmd.Resources.NomadResources.Memory.MemoryMB = 10
executor := NewExecutorWithIsolation(testlog.HCLogger(t), compute)
defer executor.Shutdown("SIGKILL", 0)
ps, err := executor.Launch(execCmd)
must.NoError(t, err)
must.Positive(t, ps.Pid)
estate, err := executor.Wait(context.Background())
must.NoError(t, err)
must.Positive(t, estate.ExitCode)
must.True(t, estate.OOMKilled)
// Shut down executor
must.NoError(t, executor.Shutdown("", 0))
executor.Wait(context.Background())
}
// TestExecutor_CgroupPaths asserts that process starts with independent cgroups
// hierarchy created for this process
func TestExecutor_CgroupPaths(t *testing.T) {

View File

@@ -791,6 +791,7 @@ type ProcessState struct {
ExitCode int32 `protobuf:"varint,2,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"`
Signal int32 `protobuf:"varint,3,opt,name=signal,proto3" json:"signal,omitempty"`
Time *timestamp.Timestamp `protobuf:"bytes,4,opt,name=time,proto3" json:"time,omitempty"`
OomKilled bool `protobuf:"varint,5,opt,name=oom_killed,json=oomKilled,proto3" json:"oom_killed,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@@ -849,6 +850,13 @@ func (m *ProcessState) GetTime() *timestamp.Timestamp {
return nil
}
func (m *ProcessState) GetOomKilled() bool {
if m != nil {
return m.OomKilled
}
return false
}
func init() {
proto.RegisterType((*LaunchRequest)(nil), "hashicorp.nomad.plugins.executor.proto.LaunchRequest")
proto.RegisterType((*LaunchResponse)(nil), "hashicorp.nomad.plugins.executor.proto.LaunchResponse")
@@ -874,74 +882,75 @@ func init() {
}
var fileDescriptor_66b85426380683f3 = []byte{
// 1058 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x6d, 0x6f, 0x1b, 0x45,
0x10, 0xee, 0xc5, 0x89, 0x5f, 0xc6, 0x76, 0xe2, 0x2e, 0xa8, 0x5c, 0x8d, 0x50, 0xcd, 0x21, 0x51,
0x0b, 0xca, 0x25, 0x4a, 0xdf, 0x90, 0x90, 0x28, 0x22, 0x2d, 0xa8, 0x52, 0x1a, 0x45, 0x97, 0x42,
0x25, 0x3e, 0x70, 0x6c, 0xee, 0xb6, 0xf6, 0x2a, 0xf6, 0xed, 0xb2, 0xbb, 0xe7, 0x04, 0x09, 0x89,
0x4f, 0xfc, 0x03, 0x90, 0xf8, 0x31, 0xfc, 0x38, 0xb4, 0x6f, 0x17, 0x3b, 0x2d, 0xd5, 0xb9, 0x88,
0x4f, 0xbe, 0x1d, 0x3f, 0xcf, 0xcc, 0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39, 0x2d, 0x26, 0xe8, 0x51, 0x4d, 0xf1, 0xd6, 0x2c, 0x2b, 0xe0, 0x8e, 0xe9, 0x53,
0xf9, 0xea, 0xed, 0x1d, 0xf8, 0xb4, 0xc6, 0xc1, 0x5e, 0xf0, 0x75, 0xeb, 0x87, 0x2d, 0xab, 0x59,
0x4d, 0xf3, 0x73, 0xf7, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2e, 0x63, 0xc4, 0xd3, 0x74, 0x0c,
0x00, 0x00,
// 1079 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x7d, 0x6f, 0x1b, 0xc5,
0x13, 0xee, 0xc5, 0x89, 0x5f, 0xc6, 0x76, 0xe2, 0xee, 0xef, 0xa7, 0x70, 0x35, 0x42, 0x35, 0x87,
0x44, 0x2d, 0x28, 0x97, 0x28, 0x7d, 0x43, 0x42, 0xa2, 0x88, 0xa4, 0xa0, 0x8a, 0x34, 0x8a, 0x2e,
0x85, 0x4a, 0xfc, 0xc1, 0xb1, 0xb9, 0xdb, 0xda, 0x2b, 0x9f, 0x6f, 0x8f, 0xdd, 0x3d, 0x27, 0x48,
0x48, 0x7c, 0x09, 0x90, 0xf8, 0x00, 0x7c, 0x0c, 0x3e, 0x1c, 0xda, 0xb7, 0x8b, 0x9d, 0x96, 0xea,
0x5c, 0xc4, 0x5f, 0xbe, 0x1d, 0x3f, 0xcf, 0xcc, 0xec, 0xce, 0xcc, 0x33, 0x70, 0x37, 0xe5, 0x74,
0x41, 0xb8, 0xd8, 0x13, 0x53, 0xcc, 0x49, 0xba, 0x47, 0x2e, 0x49, 0x52, 0x4a, 0xc6, 0xf7, 0x0a,
0xce, 0x24, 0xab, 0x8e, 0xa1, 0x3e, 0xa2, 0x0f, 0xa7, 0x58, 0x4c, 0x69, 0xc2, 0x78, 0x11, 0xe6,
0x6c, 0x8e, 0xd3, 0xb0, 0x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0xf6, 0xbd, 0x2f,
0x5b, 0xdf, 0x6f, 0x19, 0x49, 0x6b, 0xea, 0x9f, 0x7b, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0xd5,
0xc9, 0x00, 0x0a, 0x93, 0x0c, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.

View File

@@ -111,4 +111,5 @@ message ProcessState {
int32 exit_code = 2;
int32 signal = 3;
google.protobuf.Timestamp time = 4;
bool oom_killed = 5;
}

View File

@@ -111,10 +111,11 @@ func processStateToProto(ps *ProcessState) (*proto.ProcessState, error) {
return nil, err
}
pb := &proto.ProcessState{
Pid: int32(ps.Pid),
ExitCode: int32(ps.ExitCode),
Signal: int32(ps.Signal),
Time: timestamp,
Pid: int32(ps.Pid),
ExitCode: int32(ps.ExitCode),
Signal: int32(ps.Signal),
OomKilled: ps.OOMKilled,
Time: timestamp,
}
return pb, nil
@@ -127,10 +128,11 @@ func processStateFromProto(pb *proto.ProcessState) (*ProcessState, error) {
}
return &ProcessState{
Pid: int(pb.Pid),
ExitCode: int(pb.ExitCode),
Signal: int(pb.Signal),
Time: timestamp,
Pid: int(pb.Pid),
ExitCode: int(pb.ExitCode),
Signal: int(pb.Signal),
OOMKilled: pb.OomKilled,
Time: timestamp,
}, nil
}