Merge pull request #1009 from sameo/topic/ctr-create-2s-fix
oci: Remove useless crio-conmon- cgroup deletion
This commit is contained in:
commit
38c2a34b46
1 changed files with 6 additions and 5 deletions
11
oci/oci.go
11
oci/oci.go
|
@ -224,11 +224,12 @@ func (r *Runtime) CreateContainer(c *Container, cgroupParent string) (err error)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Warnf("Failed to add conmon to cgroupfs sandbox cgroup: %v", err)
|
logrus.Warnf("Failed to add conmon to cgroupfs sandbox cgroup: %v", err)
|
||||||
} else {
|
} else {
|
||||||
// XXX: this defer does nothing as the cgroup can't be deleted cause
|
// Here we should defer a crio-connmon- cgroup hierarchy deletion, but it will
|
||||||
// it contains the conmon pid in tasks
|
// always fail as conmon's pid is still there.
|
||||||
// we need to remove this defer and delete the cgroup once conmon exits
|
// Fortunately, kubelet takes care of deleting this for us, so the leak will
|
||||||
// maybe need a conmon monitor?
|
// only happens in corner case where one does a manual deletion of the container
|
||||||
defer control.Delete()
|
// through e.g. runc. This should be handled by implementing a conmon monitoring
|
||||||
|
// routine that does the cgroup cleanup once conmon is terminated.
|
||||||
if err := control.Add(cgroups.Process{Pid: cmd.Process.Pid}); err != nil {
|
if err := control.Add(cgroups.Process{Pid: cmd.Process.Pid}); err != nil {
|
||||||
logrus.Warnf("Failed to add conmon to cgroupfs sandbox cgroup: %v", err)
|
logrus.Warnf("Failed to add conmon to cgroupfs sandbox cgroup: %v", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue