Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runc --systemd-cgroup update does not update systemd scope #2287

Closed
kolyshkin opened this issue Apr 2, 2020 · 1 comment · Fixed by #2343
Closed

runc --systemd-cgroup update does not update systemd scope #2287

kolyshkin opened this issue Apr 2, 2020 · 1 comment · Fixed by #2343

Comments

@kolyshkin
Copy link
Contributor

A repro

  1. Prepare a bundle and a spec. Amend the config.json with
        "pids": {
                "limit": 55
        }

in the linux.resources section, and a long-lived process such as sleep.

  1. Start the container:
# runc --systemd-cgroup run -d keke
  1. Check its pids limit in cgroups scope, as well as in cgroupfs:
# systemctl show runc-keke.scope | grep 'Task'
TasksCurrent=2
TasksAccounting=yes
TasksMax=55

# cat /sys/fs/cgroup/system.slice/runc-keke.scope/pids.max 
55
  1. Update the limit:
# runc --systemd-cgroup update keke --pids-limit 66
  1. Check again:
# systemctl show runc-keke.scope | grep 'Task'
TasksCurrent=2
TasksAccounting=yes
TasksMax=55

# cat /sys/fs/cgroup/system.slice/runc-keke.scope/pids.max 
66

As we can see, the kernel and the systemd is now in disagreement about the limit.

  1. Check that the limit can in principal be updated:
# systemctl show runc-keke.scope | grep 'Task'
TasksCurrent=2
TasksAccounting=yes
TasksMax=77
DropInPaths=/run/systemd/transient/runc-keke.scope.d/50-TasksMax.conf
# cat /sys/fs/cgroup/system.slice/runc-keke.scope/pids.max 
77

In the above example, we set/check/update pids.limit, but all the other resources behave in a similar way.

The cause of this is Set() method of systemd.UnifiedManager, which only uses fsManager to set the updated values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant