summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-02-06 19:53:48 +0100
committerGitHub <noreply@github.com>2020-02-06 19:53:48 +0100
commit21a80e53b55fbbad252c198bd8084dbecd22fcd6 (patch)
tree3210c4924de33b09b18c5956cd29f9395c6d038b
parent62111bceb7dab4fc51760b86f762df3716f296fc (diff)
parenteed2ad9ef257fab11f76589c68f98bd595dd4396 (diff)
downloadpodman-21a80e53b55fbbad252c198bd8084dbecd22fcd6.tar.gz
podman-21a80e53b55fbbad252c198bd8084dbecd22fcd6.tar.bz2
podman-21a80e53b55fbbad252c198bd8084dbecd22fcd6.zip
Merge pull request #5099 from mheon/fix_pod_cgroup_pids
Only modify conmon cgroup if we have running containers
-rw-r--r--libpod/runtime_pod_linux.go12
1 files changed, 4 insertions, 8 deletions
diff --git a/libpod/runtime_pod_linux.go b/libpod/runtime_pod_linux.go
index 5b0111b85..4afd5760a 100644
--- a/libpod/runtime_pod_linux.go
+++ b/libpod/runtime_pod_linux.go
@@ -193,8 +193,6 @@ func (r *Runtime) removePod(ctx context.Context, p *Pod, removeCtrs, force bool)
}
}
- var removalErr error
-
// We're going to be removing containers.
// If we are CGroupfs cgroup driver, to avoid races, we need to hit
// the pod and conmon CGroups with a PID limit to prevent them from
@@ -205,7 +203,7 @@ func (r *Runtime) removePod(ctx context.Context, p *Pod, removeCtrs, force bool)
conmonCgroupPath := filepath.Join(p.state.CgroupPath, "conmon")
conmonCgroup, err := cgroups.Load(conmonCgroupPath)
if err != nil && err != cgroups.ErrCgroupDeleted && err != cgroups.ErrCgroupV1Rootless {
- removalErr = errors.Wrapf(err, "error retrieving pod %s conmon cgroup %s", p.ID(), conmonCgroupPath)
+ logrus.Errorf("Error retrieving pod %s conmon cgroup %s: %v", p.ID(), conmonCgroupPath, err)
}
// New resource limits
@@ -216,15 +214,13 @@ func (r *Runtime) removePod(ctx context.Context, p *Pod, removeCtrs, force bool)
// Don't try if we failed to retrieve the cgroup
if err == nil {
if err := conmonCgroup.Update(resLimits); err != nil {
- if removalErr == nil {
- removalErr = errors.Wrapf(err, "error updating pod %s conmon group", p.ID())
- } else {
- logrus.Errorf("Error updating pod %s conmon cgroup %s: %v", p.ID(), conmonCgroupPath, err)
- }
+ logrus.Warnf("Error updating pod %s conmon cgroup %s PID limit: %v", p.ID(), conmonCgroupPath, err)
}
}
}
+ var removalErr error
+
ctrNamedVolumes := make(map[string]*ContainerNamedVolume)
// Second loop - all containers are good, so we should be clear to