Repository navigation
packaging: cocoon-agent keeps running when the OOM killer kills one of its exec children - #21
Merged
Merged
Conversation
…f its exec children (OOMPolicy=continue)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
packaging/cocoon-agent.service now sets
OOMPolicy=continue.Why
Commands run through cocoon-agent (
cocoon vm exec, kubectl exec) live in cocoon-agent.service's cgroup, because KillMode=control-group keeps them there. With the defaultOOMPolicy=stop, one kernel OOM kill of any such command makes systemd stop the whole unit. That kills the agent and every other in-flight exec, and vsock exec fails untilRestart=alwaysbrings the agent back.The same mechanism was reproduced on silkd.service, which had the same unit shape (cocoonstack/sandbox#377). On a 7.9 GiB guest with no swap, a growing memory hog was started through the daemon's exec:
Killed process … (python3) … oom_score_adj:0).sleepstarted earlier through the same daemon dies with the unit.The same guest runs cocoon-agent.service with
OOMPolicy=stopand adj 0, so a hog started throughcocoon vm exectakes the agent down the same way.With
OOMPolicy=continue, the OOM killer still picks the hog, and the agent and its other execs keep running.systemctl stopstill tears the cgroup down as before. The setting has no runtime cost.Checks
systemd-analyze verify(systemd 255) on the unit: rc 0.