Commit ac78160
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`).
`container.Kill` no longer sends signals to all container processes.
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 ac78160
2 files changed
+1
-14
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 | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | 81 | | |
85 | 82 | | |
86 | 83 | | |
| |||
0 commit comments