cgroup2: implement containerd.events.TaskOOM event
How to test (from https://github.com/opencontainers/runc/pull/2352#issuecomment-620834524): (host)$ sudo swapoff -a (host)$ sudo ctr run -t --rm --memory-limit $((1024*1024*32)) docker.io/library/alpine:latest foo (container)$ sh -c 'VAR=$(seq 1 100000000)' An event `/tasks/oom {"container_id":"foo"}` will be displayed in `ctr events`. Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
3
vendor/github.com/containerd/cgroups/control.go
generated
vendored
3
vendor/github.com/containerd/cgroups/control.go
generated
vendored
@@ -82,6 +82,9 @@ type Cgroup interface {
|
||||
Thaw() error
|
||||
// OOMEventFD returns the memory subsystem's event fd for OOM events
|
||||
OOMEventFD() (uintptr, error)
|
||||
// RegisterMemoryEvent returns the memory subsystems event fd for whatever memory event was
|
||||
// registered for. Can alternatively register for the oom event with this method.
|
||||
RegisterMemoryEvent(MemoryEvent) (uintptr, error)
|
||||
// State returns the cgroups current state
|
||||
State() State
|
||||
// Subsystems returns all the subsystems in the cgroup
|
||||
|
||||
Reference in New Issue
Block a user