Commit b513929
committed
Restore runc kill all behavior for init processes
PR #2538 removed the `runc kill --all` flag, when signaling containers.
However, when cleaning up after the init process exists, the `--all`
flag is still needed to remove any potentially orphaned processes when
using runc before v1.2.
See: opencontainers/runc@f8ad20f#diff-ade6035c3e554d7627cdc368b27f475fc0dad83e02382a1dea9cae9b75871087
Additionally, switch to using error strings directly from runc code in
`internal\guest\runtime\runc\utils.go`: they have been available since
runc v1.1.0-rc.1.
See: opencontainers/runc#3033
Also, add logic to match on container not/still running error strings
and return them for `Kill`, since returning
`ERROR_VMCOMPUTE_SYSTEM_ALREADY_STOPPED` (`0xc0370110`) when killing a
stopped container is expected behavior and handled appropriately in
`"cmd/containerd-shim-runhcs-v1".(*hcsExec).Kill()`.
Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>1 parent 31ea91d commit b513929
File tree
6 files changed
+45
-17
lines changed- cmd/containerd-shim-runhcs-v1
- internal
- bridgeutils/gcserr
- guest/runtime
- hcsv2
- runc
6 files changed
+45
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
449 | | - | |
| 449 | + | |
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
54 | | - | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
218 | 221 | | |
219 | 222 | | |
220 | 223 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
80 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
81 | 107 | | |
82 | 108 | | |
83 | 109 | | |
84 | 110 | | |
85 | 111 | | |
86 | | - | |
| 112 | + | |
87 | 113 | | |
88 | 114 | | |
89 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | 7 | | |
10 | 8 | | |
11 | 9 | | |
| |||
65 | 63 | | |
66 | 64 | | |
67 | 65 | | |
68 | | - | |
| 66 | + | |
69 | 67 | | |
70 | 68 | | |
71 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
127 | | - | |
128 | | - | |
129 | 128 | | |
130 | | - | |
| 129 | + | |
131 | 130 | | |
132 | | - | |
133 | | - | |
| 131 | + | |
134 | 132 | | |
135 | | - | |
136 | | - | |
| 133 | + | |
137 | 134 | | |
138 | | - | |
139 | | - | |
| 135 | + | |
140 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| |||
0 commit comments