libcontainer: Add support for the "pausing" status #1704
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Builds on #1703; review that first.
The freezer controller distinguishes between freezing and frozen. We've had a
Pausingsince dbb515f (2014-07-08), but had never implemented it. This pull-request adds the missing implementation.I haven't updated
libcontainer/cgroups, which has used a blocking freeze change since 3e8849f (2014-06-04). The cgroups interface doesn't distinguish between blocking and non-blocking sets, so there's no way to say “I want to start freezing, but don't need to block until completion”.I haven't added integration tests either. All of our current tests (
state.batsandpause.bats) assume a complete transition topaused. That makes sense becauserunc pause …is based on the blockinglibcontainer/cgroupsimplementation. The only way to seepausingwould be to have a parallel state call during the pause call. Here's how the timing could work out:pause.state, which readsTHAWEDand outputsrunning(orcreated, or whatever).pausestarts freezing the controller.state, which readsFREEZINGand outputspausing.pausefinishes freezing the controller.state, which readsFROZENand outputspaused.pauseexits.I'm not sure how to get a test where the
statecall consistently fires at 4 and not at 2 or 6.