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

libcontainer: Add support for the "pausing" status #1704

Closed
wants to merge 1 commit into from

Conversation

wking
Copy link
Contributor

@wking wking commented Jan 25, 2018

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 and pause.bats) assume a complete transition to paused. That makes sense because runc pause … is based on the blocking libcontainer/cgroups implementation. The only way to see pausing would be to have a parallel state call during the pause call. Here's how the timing could work out:

  1. Call pause.
  2. Call state, which reads THAWED and outputs running (or created, or whatever).
  3. pause starts freezing the controller.
  4. Call state, which reads FREEZING and outputs pausing.
  5. pause finishes freezing the controller.
  6. Call state, which reads FROZEN and outputs paused.
  7. 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.

The freezer controller distinguishes between freezing and frozen [1].
We've had a "Pausing" since dbb515f (Update api proposal,
2014-07-08), but had never implemented it.  This commit adds the
missing implementation.

I haven't updated libcontainer/cgroups, which has used a blocking
freeze change since 3e8849f (implement wait on freeze, 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 and pause.bats) assume a complete transition to 'paused'.
That makes sense because 'runc pause ...' is based on the blocking
libcontainer/cgroups implementation.  The only way to see 'pausing'
would be to have a parallel state call during the pause call.  Here's
how the timing could work out:

1. Call 'pause'.
2. Call 'state', which reads THAWED and outputs 'running' (or
   'created', or whatever).
3. 'pause' starts freezing the controller.
4. Call 'state', which reads FREEZING and outputs 'pausing'.
5. 'pause' finishes freezing the controller.
6. Call 'state', which reads FROZEN and outputs 'paused'.
7. '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.

[1]: https://www.kernel.org/doc/Documentation/cgroup-v1/freezer-subsystem.txt

Signed-off-by: W. Trevor King <wking@tremily.us>
@wking
Copy link
Contributor Author

wking commented Feb 2, 2018

Rebased onto master with 2f8ae9c87b4cc3 now that #1703 has landed. No changes to the tip commit, but the rebase removes the #1703 changes from GitHub's PR diff.

@kolyshkin
Copy link
Contributor

We've removed "pausing" state in PR #3360

@kolyshkin kolyshkin closed this Jun 15, 2024
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

Successfully merging this pull request may close these issues.

2 participants