Skip to content

daemon: fix restoring container with missing task#45800

Merged
thaJeztah merged 1 commit intomoby:masterfrom
corhere:fix-45788-restore-exit-status
Jun 23, 2023
Merged

daemon: fix restoring container with missing task#45800
thaJeztah merged 1 commit intomoby:masterfrom
corhere:fix-45788-restore-exit-status

Conversation

@corhere
Copy link
Copy Markdown
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>
@corhere corhere added this to the 25.0.0 milestone Jun 23, 2023
@corhere corhere force-pushed the fix-45788-restore-exit-status branch from 1b070f5 to 165dfd6 Compare June 23, 2023 15:29
Copy link
Copy Markdown
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
Copy Markdown
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

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