-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fixing container start when cgroup subsystem not found #341
Conversation
Signed-off-by: Rajasekaran <rajasec79@gmail.com>
I don't think that we should silently continue on if some subsystems aren't mounted. Failing is better. |
Yes, we had this same discussion in the past when this repository was libcontainer. I can try to find the discussion again for history but there are some subsystems that are optional but we want a hard fail because if you don't have some of these cgroups then we cannot guarantee some of the aspects of a container. |
@crosbymichael @mrunalp As per your comment, we want hard fail, I meant to say when subsystem is not mounted or not available, don't fail during set operation, fail during Join operation, where it returns cgroup subsystem not found. With current implementation, memory subsystem is handled this way too(silently continues). is it different than other subsystems ? Moreover with current implementation If it is 0 or null, container start ignores during set operations ( for not mounted cgroup subsystems) |
@rajasec is there a reason why you are hitting this issue? What is the root cause? |
@crosbymichael Root cause So it went ahead to set the values it failed during setting up of cpu.shares, because the directory or mountpoint does not exists. This PR handles, if specific subsystem is not found in the host, Don't try to set the values instead return back ( similar to memory subsystem) |
@rajasec @crosbymichael The story was:
|
@hqhq what should we do with this PR then? |
@crosbymichael The main problem @rajasec got in this PR is intended, the other problem he mentioned in the comments is fixed by #343 , so I think we can close this PR then. |
@hqhq I agree that we need hard failure. But if subsystem is not found or not mounted, my question is why we go and fail in set operation instead we can fail at join operation itself ? in that case , we don't even allow the code to do set of values. Also cgroups.IsNotFound(err) function is not having much meaning, as we always negate when subsystem not found |
I agree fail at
Sorry I don't get it, what do you mean "we always negate when subsystem not found"? If subsystem is not found and we are not using it (by assigning any valid values in runtime.json), we don't negate it. |
@hqhq @crosbymichael |
…e-rlimits-to-process Move rlimits to process
Through 0bcb711 (Merge pull request opencontainers#341 2016-03-10). Signed-off-by: W. Trevor King <wking@tremily.us> Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
With current runc implementation, if the cgroup subsystem is not mounted in the host, subsequent directories are not created inside the container. But Set interface is called to write to respective subsystem attributes ( if the runtime.json had the right values). In that case container failed to start.
Example
In runtime.json, I've added the cpu shares and blkio related parameters
After unmounting the cpu and blkio subsystem from host, the container failed to start due to following errors
FATA[0000] Container start failed: [8] System error: no such directory for cpu.shares
As directories are not created if subsystem is not mounted, Let us try not to set the values for the respective subsystems ( if not mounted) and gracefully start the container instead of failing
Signed-off-by: Rajasekaran rajasec79@gmail.com