MCPcopy Create free account
hub / github.com/containerd/cgroups / Kill

Method Kill

cgroup2/manager.go:423–435  ·  view source on GitHub ↗

Kill will try to forcibly exit all of the processes in the cgroup. This is equivalent to sending a SIGKILL to every process. On kernels 5.14 and greater this will use the cgroup.kill file, on anything that doesn't have the cgroup.kill file, a manual process of freezing -> sending a SIGKILL to every

()

Source from the content-addressed store, hash-verified

421// file, a manual process of freezing -> sending a SIGKILL to every process -> thawing
422// will be used.
423func (c *Manager) Kill() error {
424 v := Value{
425 filename: killFile,
426 value: "1",
427 }
428 err := writeValues(c.path, []Value{v})
429 if err == nil {
430 return nil
431 }
432 log.L.Warnf("falling back to slower kill implementation: %s", err)
433 // Fallback to slow method.
434 return c.fallbackKill()
435}
436
437// fallbackKill is a slower fallback to the more modern (kernels 5.14+)
438// approach of writing to the cgroup.kill file. This is heavily pulled

Callers 2

TestKillFunction · 0.95
TestMoveToFunction · 0.95

Calls 2

fallbackKillMethod · 0.95
writeValuesFunction · 0.85

Tested by 2

TestKillFunction · 0.76
TestMoveToFunction · 0.76