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

daemon: fix restoring container with missing task #45800

Merged
merged 1 commit into from Jun 23, 2023

Conversation

corhere
Copy link
Contributor

@corhere corhere commented Jun 23, 2023

Before 4bafaa0, if the daemon was killed while a container was running and the container shim is killed before the daemon is restarted, such as if the host system is hard-rebooted, the daemon would restore the container to the stopped state and set the exit code to 255. The aforementioned commit introduced a regression where the container's exit code would instead be set to 0. Fix the regression so that the exit code is once against set to 255 on restore.

- What I did

- How I did it

- How to verify it

  • CI: new regression tests

- Description for the changelog

  • Fixed an issue where a container would be marked as exited successfully rather than failed if the system is hard-rebooted while the container is running

- A picture of a cute animal (not mandatory but encouraged)

Before 4bafaa0, if the daemon was
killed while a container was running and the container shim is killed
before the daemon is restarted, such as if the host system is
hard-rebooted, the daemon would restore the container to the stopped
state and set the exit code to 255. The aforementioned commit introduced
a regression where the container's exit code would instead be set to 0.
Fix the regression so that the exit code is once against set to 255 on
restore.

Signed-off-by: Cory Snider <csnider@mirantis.com>
Copy link
Member

@neersighted neersighted left a comment

Choose a reason for hiding this comment

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

LGTM, good find on that existing test and factoring out a helper!

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah thaJeztah merged commit da05a2e into moby:master Jun 23, 2023
102 checks passed
@corhere corhere deleted the fix-45788-restore-exit-status branch June 23, 2023 19:53
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.

Docker version 24.0.xx: Containers exiting with 0 status code on hard reboot
4 participants