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
Pausing
since 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.bats
andpause.bats
) assume a complete transition topaused
. That makes sense becauserunc pause …
is based on the blockinglibcontainer/cgroups
implementation. The only way to seepausing
would be to have a parallel state call during the pause call. Here's how the timing could work out:pause
.state
, which readsTHAWED
and outputsrunning
(orcreated
, or whatever).pause
starts freezing the controller.state
, which readsFREEZING
and outputspausing
.pause
finishes freezing the controller.state
, which readsFROZEN
and outputspaused
.pause
exits.I'm not sure how to get a test where the
state
call consistently fires at 4 and not at 2 or 6.