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

Make kill, pause, and unpause parallel. #1737

Merged
merged 1 commit into from
Nov 1, 2018

Conversation

baude
Copy link
Member

@baude baude commented Oct 31, 2018

Operations like kill, pause, and unpause -- which can operation on one or
more containers -- can greatly benefit from parallizing its main job (eq kill).

In the case of pauseand unpause, an --all option as was added. pause --all will
pause all running containers. And unpause --all will unpause all paused
containers.

Signed-off-by: baude bbaude@redhat.com

@mheon
Copy link
Member

mheon commented Oct 31, 2018

Do we have perf numbers on this? I have nothing really against it, but I feel like we're buying almost nothing here, there are not expensive operations.

@baude
Copy link
Member Author

baude commented Oct 31, 2018

yes it is faster


**--all, -a**

Unpause all running containers.
Copy link
Member

Choose a reason for hiding this comment

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

Paused containers

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

for _, ctr := range unpauseContainers {
con := ctr
f := func() error {
return con.Unpause()
Copy link
Member

Choose a reason for hiding this comment

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

This won't work for all I think - it'll throw an error on every container that is not paused

Copy link
Member Author

Choose a reason for hiding this comment

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

note that the unpauseContainers are containers in the state of paused ... so we should be ok

Copy link
Member

Choose a reason for hiding this comment

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

Could still be racy - but probably fine, given that we guarantee they are paused.

Copy link
Member

Choose a reason for hiding this comment

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

Wait, where are you verifying this? I don't see any code to filter the containers in question

Copy link
Member Author

Choose a reason for hiding this comment

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

... discussed in irc ...

unpauseFlags = []cli.Flag{
cli.BoolFlag{
Name: "all, a",
Usage: "stop all running containers",
Copy link
Member

Choose a reason for hiding this comment

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

Thought @mheon pinged this one. "stop all running" to "unpause all paused"

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@@ -9,11 +9,28 @@ podman\-pause - Pause one or more containers
## DESCRIPTION
Copy link
Member

Choose a reason for hiding this comment

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

The synopsis for each of these man pages needs to be updated. the "CONTAINER ..." now needs to be in brackets too as it's not always required due to the --all switch. See https://github.com/containers/buildah/blob/master/docs/buildah-rm.md

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

Copy link
Member

@TomSweeneyRedHat TomSweeneyRedHat left a comment

Choose a reason for hiding this comment

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

Couple doc nits, otherwise LGTM

@baude baude force-pushed the parakill branch 2 times, most recently from ab4ae10 to be34c60 Compare November 1, 2018 13:31
@mheon
Copy link
Member

mheon commented Nov 1, 2018

bot, retest this please

@mheon
Copy link
Member

mheon commented Nov 1, 2018

Ah, it's the return of the papr timeout-after-successful-test

@mheon
Copy link
Member

mheon commented Nov 1, 2018

/approve

@mheon
Copy link
Member

mheon commented Nov 1, 2018

LGTM. @TomSweeneyRedHat @umohnani8 @rhatdan PTAL

@mheon
Copy link
Member

mheon commented Nov 1, 2018

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 1, 2018
@rh-atomic-bot
Copy link
Collaborator

☔ The latest upstream changes (presumably #1738) made this pull request unmergeable. Please resolve the merge conflicts.

Operations like kill, pause, and unpause -- which can operation on one or
more containers -- can greatly benefit from parallizing its main job (eq kill).

In the case of pauseand unpause, an --all option as was added. pause --all will
pause all **running** containers.  And unpause --all will unpause all **paused**
containers.

Signed-off-by: baude <bbaude@redhat.com>
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Nov 1, 2018
@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mheon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 1, 2018
@mheon
Copy link
Member

mheon commented Nov 1, 2018

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 1, 2018
@openshift-merge-robot openshift-merge-robot merged commit d18f243 into containers:master Nov 1, 2018
@baude baude deleted the parakill branch December 22, 2019 19:01
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants