Skip to content

liverestore: Don't remove --rm containers on restart#46857

Merged
vvoland merged 2 commits intomoby:masterfrom
vvoland:liverestore-fix-46308
Nov 30, 2023
Merged

liverestore: Don't remove --rm containers on restart#46857
vvoland merged 2 commits intomoby:masterfrom
vvoland:liverestore-fix-46308

Conversation

@vvoland
Copy link
Contributor

@vvoland vvoland commented Nov 28, 2023

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

- 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)

@vvoland vvoland added area/runtime Runtime kind/bugfix PR's that fix bugs labels Nov 28, 2023
@vvoland vvoland added this to the 25.0.0 milestone Nov 28, 2023
@vvoland vvoland force-pushed the liverestore-fix-46308 branch from 2be58fb to 3eb9f78 Compare November 28, 2023 10:34
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>
@vvoland vvoland force-pushed the liverestore-fix-46308 branch from 3eb9f78 to c5ea3d5 Compare November 28, 2023 11:59
@vvoland vvoland self-assigned this Nov 28, 2023
Copy link
Member

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@akerouanton akerouanton left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for taking care of this!

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>
@vvoland vvoland force-pushed the liverestore-fix-46308 branch from 936e41b to 3a0af5a Compare November 30, 2023 09:16
@vvoland
Copy link
Contributor Author

vvoland commented Nov 30, 2023

FYI, the last force push is just a small wording correction:

-		return poll.Continue("waiting for process to be finish")
+		return poll.Continue("waiting for process to finish")

@vvoland
Copy link
Contributor Author

vvoland commented Nov 30, 2023

Thanks for reviewing!

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.

live restore: containers with auto remove are removed on engine restart

5 participants