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

container pause status #217

Closed
rajasec opened this issue Aug 21, 2015 · 5 comments
Closed

container pause status #217

rajasec opened this issue Aug 21, 2015 · 5 comments

Comments

@rajasec
Copy link
Contributor

rajasec commented Aug 21, 2015

@crosbymichael @LK4D4 @mrunalp
When I've tried to get the container status whether it is paused or frozen, Eventhough it was paused by runc container.status always returns Running..
Current implementation look for
if c.config.Cgroups != nil && c.config.Cgroups.Freezer == configs.Frozen
c.config.Cgroups.Freezer always comes with empty, as it never got initialized with
any values in cgroup creation in spec.go ( also confirmed by looking freezer value in state.json).
Also realized that Freezer subsystem was never part of spec_linux.
Docker handles this situation by adding flag to true to container.Paused variable during container pause.
is runc going to have different implementation to check container status for pause situation.
For checking the container status, do we need to check by config value ( as per current implementation) or check the run time of cgroups freezer for the specific container

@wking
Copy link
Contributor

wking commented Aug 21, 2015

On Thu, Aug 20, 2015 at 10:11:58PM -0700, Rajasekaran wrote:

For checking the container status, do we need to check by config
value ( as per current implementation) or check the run time of
cgroups freezer for the specific container

Since a config / state file can be stale, I think it makes more sense
to ask the kernel directly for the cgroups freezer status 1.
There's some discussion of state content vs. direct kernel lookups in
opencontainers/runtime-spec#41 and opencontainers/runtime-spec#87. With the
application's process ID:

$ ps -o cgroup 29285
CGROUP
8:perf_event:/oci-gentoo-minimal,7:freezer:/oci-gentoo-minimal,6:devices:/oci-gentoo-minimal,5:memory:/oci-gentoo-minimal,4:cpuacct:/oci-gentoo-minimal,3:cpu:/oci-gentoo-minimal,2:cpuset:/oci-gentoo-minimal
$ cat /sys/fs/cgroup/freezer/oci-gentoo-minimal/freezer.state
THAWED

@rajasec
Copy link
Contributor Author

rajasec commented Aug 21, 2015

Thanks @wking for the confirmation
Exactly I'm working on the same thing to get the freezer state from cgroup instead of config file , will generate the PR shortly.

@mikebrow
Copy link
Member

I also noted this bug when testing the new runc ps command. Seems the state in the state.json file should be updated upon successful state change no? Otherwise what's the point of the file?

@rajasec
Copy link
Contributor Author

rajasec commented Nov 24, 2015

With new container state machine changes #311, this will get fixed.

On Tue, Nov 24, 2015 at 4:38 AM, Mike Brown notifications@github.com
wrote:

I also noted this bug when testing the new runc ps command. Seems the
state in the state.json file should be updated upon successful state change
no? Otherwise what's the point of the file?


Reply to this email directly or view it on GitHub
#217 (comment)
.

@rajasec
Copy link
Contributor Author

rajasec commented Jan 5, 2016

Got fixed by #311
Closing this issue.

@rajasec rajasec closed this as completed Jan 5, 2016
stefanberger pushed a commit to stefanberger/runc that referenced this issue Sep 8, 2017
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

No branches or pull requests

3 participants