Commit 009d775
committed
gcs: do not trigger container shutdown when signaling init process
When implementing signal container process enforcement policy we
introduced a bug, where instead of signalling just the container
init process we ended up sending signals (SIGTERM or SIGKILL) to
all processes running inside a container (by invoking `runc kill --all`).
This results in an unpleasant behavior, where the init process
could be handling (e.g. ignoring) SIGTERM, where as other processes
inside container don't.
This PR makes a change to the order in which the signal container
policy is enforced:
- always call `EnforceSignalContainerProcessPolicy` before sending
any signals. Otherwise, this looks like a bug, since we would
never call `EnforceSignalContainerProcessPolicy` with
`signalingInitProcess == true` for `SIGTERM` and `SIGKILL` and
potentially bypassing policies, which do not allow `SIGTERM` or
`SIGKILL` to be sent to the init process.
- no longer call `ShutdownContainer` and instead revert back to
calling `process.Kill`.
Signed-off-by: Maksim An <maksiman@microsoft.com>1 parent 6efa5fd commit 009d775
2 files changed
+3
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
683 | 683 | | |
684 | 684 | | |
685 | 685 | | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | | - | |
696 | | - | |
| 686 | + | |
697 | 687 | | |
698 | 688 | | |
699 | 689 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
| 78 | + | |
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| |||
0 commit comments