Skip to content

Commit

Permalink
Merge pull request #2814 from kolyshkin/systemd-apply
Browse files Browse the repository at this point in the history
libct/cgroups/systemd: don't set limits in Apply
  • Loading branch information
Mrunal Patel authored Feb 23, 2021
2 parents e00273e + af521ed commit f36d64d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
9 changes: 2 additions & 7 deletions libcontainer/cgroups/systemd/v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ func genV1ResourcesProperties(c *configs.Cgroup, conn *systemdDbus.Conn) ([]syst

if r.PidsLimit > 0 || r.PidsLimit == -1 {
properties = append(properties,
newProp("TasksAccounting", true),
newProp("TasksMax", uint64(r.PidsLimit)))
}

Expand Down Expand Up @@ -158,7 +157,8 @@ func (m *legacyManager) Apply(pid int) error {
properties = append(properties,
newProp("MemoryAccounting", true),
newProp("CPUAccounting", true),
newProp("BlockIOAccounting", true))
newProp("BlockIOAccounting", true),
newProp("TasksAccounting", true))

// Assume DefaultDependencies= will always work (the check for it was previously broken.)
properties = append(properties,
Expand All @@ -168,11 +168,6 @@ func (m *legacyManager) Apply(pid int) error {
if err != nil {
return err
}
resourcesProperties, err := genV1ResourcesProperties(c, dbusConnection)
if err != nil {
return err
}
properties = append(properties, resourcesProperties...)
properties = append(properties, c.SystemdProps...)

// We have to set kernel memory here, as we can't change it once
Expand Down
6 changes: 0 additions & 6 deletions libcontainer/cgroups/systemd/v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ func genV2ResourcesProperties(c *configs.Cgroup, conn *systemdDbus.Conn) ([]syst

if r.PidsLimit > 0 || r.PidsLimit == -1 {
properties = append(properties,
newProp("TasksAccounting", true),
newProp("TasksMax", uint64(r.PidsLimit)))
}

Expand Down Expand Up @@ -283,11 +282,6 @@ func (m *unifiedManager) Apply(pid int) error {
if err != nil {
return err
}
resourcesProperties, err := genV2ResourcesProperties(c, dbusConnection)
if err != nil {
return err
}
properties = append(properties, resourcesProperties...)
properties = append(properties, c.SystemdProps...)

if err := startUnit(dbusConnection, unitName, properties); err != nil {
Expand Down

0 comments on commit f36d64d

Please sign in to comment.