[23.0 backport] Fix exit-event handling for Kata runtime#44892
Merged
neersighted merged 1 commit intoFeb 6, 2023
moby:23.0moby/moby:23.0from
corhere:backport-23.0/fix-kata-exec-exitcorhere/moby:backport-23.0/fix-kata-exec-exitCopy head branch name to clipboard
Merged
[23.0 backport] Fix exit-event handling for Kata runtime#44892neersighted merged 1 commit intomoby:23.0moby/moby:23.0from corhere:backport-23.0/fix-kata-exec-exitcorhere/moby:backport-23.0/fix-kata-exec-exitCopy head branch name to clipboard
neersighted merged 1 commit into
moby:23.0moby/moby:23.0from
corhere:backport-23.0/fix-kata-exec-exitcorhere/moby:backport-23.0/fix-kata-exec-exitCopy head branch name to clipboard
Conversation
corhere
marked this pull request as draft
January 31, 2023 17:11
The Pid field of an exit event cannot be relied upon to differentiate exits of the container's task from exits of other container processes, i.e. execs. The Pid is reported by the runtime and is implementation- defined so there is no guarantee that a task's pid is distinct from the pids of any other process in the same container. In particular, kata-containers reports the pid of the hypervisor for all exit events. Update the daemon to differentiate container exits from exec exits by inspecting the event's ProcessID. The local_windows libcontainerd implementation already sets the ProcessID to InitProcessName on container exit events. Update the remote libcontainerd implementation to match. ContainerD guarantees that the process ID of a task (container init process) is set to the corresponding container ID, so use that invariant to distinguish task exits from other process exits. Signed-off-by: Cory Snider <csnider@mirantis.com>
corhere
force-pushed
the
backport-23.0/fix-kata-exec-exit
branch
from
January 31, 2023 17:15
19105c7 to
975bdb2
Compare
corhere
marked this pull request as ready for review
January 31, 2023 17:15
neersighted
approved these changes
Feb 3, 2023
Member
|
@AkihiroSuda ptal 🤗 |
cpuguy83
approved these changes
Feb 6, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
- What I did
Fixed exit event handling in a pre-#43564 world.
- How I did it
Without cherry-picking.
- How to verify it
Start a container with the
io.containerd.kata.v2runtime and exec a command in it. Verify the container is still running according todocker psafter the exec exits.- Description for the changelog
io.containerd.kata.v2runtime.- A picture of a cute animal (not mandatory but encouraged)