Skip to content

[24.0 backport] liverestore: Don't remove --rm containers on restart#46869

Merged
thaJeztah merged 2 commits intomoby:24.0from
vvoland:liverestore-fix-46308-24
Nov 30, 2023
Merged

[24.0 backport] liverestore: Don't remove --rm containers on restart#46869
thaJeztah merged 2 commits intomoby:24.0from
vvoland:liverestore-fix-46308-24

Conversation

@vvoland
Copy link
Contributor

@vvoland vvoland commented Nov 30, 2023

When live-restore is enabled, containers with autoremove enabled shouldn't be forcibly killed when engine restarts.

(cherry picked from commit 3a0af5a)
(unclean cherry-pick)

- What I did

- How I did it
Added extra check and integration test.

- How to verify it
TestLiveRestore

- Description for the changelog

- live restore: Containers with auto remove (`docker run --rm`) are no longer forcibly removed on engine restart.

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

When live-restore is enabled, containers with autoremove enabled
shouldn't be forcibly killed when engine restarts.
They still should be removed if they exited while the engine was down
though.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit c5ea3d5)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Replace `time.Sleep` with a poll that checks if process no longer exists
to avoid possible race condition.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 3a0af5a)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@vvoland vvoland added area/runtime Runtime kind/bugfix PR's that fix bugs labels Nov 30, 2023
@vvoland vvoland added this to the 24.0.8 milestone Nov 30, 2023
@vvoland vvoland self-assigned this Nov 30, 2023
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 afcd2cd into moby:24.0 Nov 30, 2023
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.

2 participants