MCPcopy Create free account
hub / github.com/containerd/containerd / killTask

Function killTask

plugins/restart/change.go:81–103  ·  view source on GitHub ↗
(ctx context.Context, container containerd.Container)

Source from the content-addressed store, hash-verified

79}
80
81func killTask(ctx context.Context, container containerd.Container) error {
82 task, err := container.Task(ctx, nil)
83 if err == nil {
84 wait, err := task.Wait(ctx)
85 if err != nil {
86 if _, derr := task.Delete(ctx); derr == nil {
87 return nil
88 }
89 return err
90 }
91 if err := task.Kill(ctx, syscall.SIGKILL, containerd.WithKillAll); err != nil {
92 if _, derr := task.Delete(ctx); derr == nil {
93 return nil
94 }
95 return err
96 }
97 <-wait
98 if _, err := task.Delete(ctx); err != nil {
99 return err
100 }
101 }
102 return nil
103}

Callers 2

applyMethod · 0.85
applyMethod · 0.85

Calls 4

TaskMethod · 0.65
WaitMethod · 0.65
DeleteMethod · 0.65
KillMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…