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

runc checkpoint: destroy only on success #3655

Merged
merged 1 commit into from
Nov 22, 2022

Conversation

kolyshkin
Copy link
Contributor

If checkpointing has failed, the container is kept running. We do not want to, and we can't remove it in such case.

Do not try to remove the container if there's an error from checkpointing.

This avoids an unclear error message from destroy() saying "container still running" or "container paused".

While at it, avoid using defer since it does not make a lot of sense here.

Fixes: #3577

If checkpointing has failed, the container is kept running. We do not
want to, and we can't remove it in such case.

Do not try to remove the container if there's an error from
checkpointing.

This avoids an unclear error message from destroy() saying "container
still running" or "container paused".

While at it, avoid using defer since it does not make a lot of sense
here.

Fixes: opencontainers#3577
Reported-by: gosoon <tianfeiyu0@gmail.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@kolyshkin
Copy link
Contributor Author

@gosoon @adrianreber @rst0git PTAL

@kolyshkin kolyshkin marked this pull request as ready for review November 3, 2022 23:18
Copy link
Contributor

@adrianreber adrianreber left a comment

Choose a reason for hiding this comment

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

It feels like we had to deal with something like this a couple of years ago. Looks good to me.

@kolyshkin kolyshkin added this to the 1.2.0 milestone Nov 4, 2022
Copy link
Contributor

@rst0git rst0git left a comment

Choose a reason for hiding this comment

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

LGTM

@kolyshkin
Copy link
Contributor Author

@thaJeztah PTAL (low handing fruit here)

@mrunalp mrunalp merged commit 25c9e88 into opencontainers:main Nov 22, 2022
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.

runc checkpoint: destroy container error
5 participants