Add bounds on max oom_score_adj value for AdjustOOMScore
oom_score_adj must be in the range -1000 to 1000. In AdjustOOMScore if containerd's score is already at the maximum value we should set that value for the shim instead of trying to set 1001 which is invalid. Signed-off-by: Simon Kaegi <simon_kaegi@ca.ibm.com>
This commit is contained in:
@@ -2043,6 +2043,10 @@ func TestShimOOMScore(t *testing.T) {
|
||||
}
|
||||
|
||||
expectedScore := containerdScore + 1
|
||||
if expectedScore > sys.OOMScoreAdjMax {
|
||||
expectedScore = sys.OOMScoreAdjMax
|
||||
}
|
||||
|
||||
// find the shim's pid
|
||||
if cgroups.Mode() == cgroups.Unified {
|
||||
processes, err := cg2.Procs(false)
|
||||
|
Reference in New Issue
Block a user