Skip to content

Conversation

@thaJeztah
Copy link
Member

fixes #29833

Commit 56f77d5 (#23430) added support for cpu-rt-period and cpu-rt-runtime, but always initialized the cgroup path, even if not used.

As a result, containers failed to start on a read-only filesystem.

This patch only creates the cgroup path if one of these options is set.

ping @erikstmartin @mlaventure PTAL. I think this should still do all that's required, but please double check.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This recursive call confused me; not sure if that was needed, but perhaps I misunderstood 😊

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the recursion is needed because all of the parents have to have a value <= than the targeted one in the path for this to work if I'm not mistaken

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, right, so a cgroup has to be created at every level if it doesn't exist? (I don't think this function actually checks it's values, only creates)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, from what I could gather from the original code.

Also, reading the original PR, the following is in the description:

You will also need to ensure that the system and all parent cgroups have values set for the period and runtime as this limits what the children can be set to.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added back the recursive call, but moved it after the new checks

@lrusak
Copy link

lrusak commented Jan 3, 2017

I can confirm that this fixes #29833

@thaJeztah
Copy link
Member Author

Thanks @lrusak! Now we need to check if it still does everything that it needs to do 😊 not too familiar with this part, so I'm awaiting some reviews 😄

commit 56f77d5
added support for cpu-rt-period and cpu-rt-runtime,
but always initialized the cgroup path, even if not
used.

As a result, containers failed to start on a
read-only filesystem.

This patch only creates the cgroup path if
one of these options is set.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the dont-create-init-path branch from a4554d4 to f285d5b Compare January 9, 2017 14:29
Copy link
Contributor

@mlaventure mlaventure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

TestSwarmContainerAutoStart seems to still be flaky unfortunately.

Copy link
Contributor

@LK4D4 LK4D4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@LK4D4 LK4D4 merged commit 9248351 into moby:master Jan 9, 2017
@GordonTheTurtle GordonTheTurtle added this to the 1.14.0 milestone Jan 9, 2017
@thaJeztah thaJeztah deleted the dont-create-init-path branch January 9, 2017 16:48
@lrusak
Copy link

lrusak commented Jan 9, 2017

Can this go in for 1.13 as a bug fix?

@thaJeztah
Copy link
Member Author

We've frozen 1.13.0 rc's to only add critical issues, but if there's a patch release for 1.13, i'll bring this up for consideration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error response from daemon: linux init cgroups path: mkdir /init.scope: read-only file system

8 participants