Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: A recent patch fixes a bug that would unnecessarily kill innocent (well-behaving) victims in a noisy cgroup. This diff adds tests to ensure that double killing does not happen when the kernelkill flag is on for BaseKillPlugin. The problem before was that when using cgroup.kill, kernelKill would return PluginRet::CONTINUE as an indication that the kill failed, even though the kernel had already initiated a kill (and likely, the cgroup was already dead) since pids.current isn't immediately updated. Since we expect cgroup.kill to always work eventually, kernelKillCgroup should always return a nonzero number --> tryToKillCgroup should always return STOP (if there are nonempty cgroups). We test this by issuing a kernelKill to a fake non-empty cgroup, and never empty out pids.current. We should still expect PluginRet::STOP, stopping the action chain and preventing double kills. Reviewed By: lnyng Differential Revision: D64911473 fbshipit-source-id: e0e3c119e538643a0ee0984c1e0a03bd1887934d
- Loading branch information