Skip to content

runc checkpoint: destroy only on success#3655

Merged
mrunalp merged 1 commit intoopencontainers:mainfrom
kolyshkin:cpt-destroy-on-err
Nov 22, 2022
Merged

runc checkpoint: destroy only on success#3655
mrunalp merged 1 commit intoopencontainers:mainfrom
kolyshkin:cpt-destroy-on-err

Conversation

@kolyshkin
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

@gosoon @adrianreber @rst0git PTAL

@kolyshkin kolyshkin marked this pull request as ready for review November 3, 2022 23:18
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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