Set shim OOM scores to +1 containerd daemon score
This changes the shim's OOM score from a static max killable of -999 to be +1 of the containerd daemon's score. This should allow the shim's to be killed first in an OOM condition but leave the daemon alone for a bit to help cleanup and manage the containers during this situation. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -190,8 +190,8 @@ func (s *service) StartShim(ctx context.Context, id, containerdBinary, container
|
||||
}
|
||||
}
|
||||
}
|
||||
if err := shim.SetScore(cmd.Process.Pid); err != nil {
|
||||
return "", errors.Wrap(err, "failed to set OOM Score on shim")
|
||||
if err := shim.AdjustOOMScore(cmd.Process.Pid); err != nil {
|
||||
return "", errors.Wrap(err, "failed to adjust OOM score for shim")
|
||||
}
|
||||
return address, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user