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

[23.0 backport] Fix exit-event handling for Kata runtime #44892

Merged
merged 1 commit into from Feb 6, 2023

Conversation

corhere
Copy link
Contributor

@corhere corhere commented Jan 31, 2023

- 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.v2 runtime and exec a command in it. Verify the container is still running according to docker ps after the exec exits.

- Description for the changelog

  • Fixed an issue with the handling of process exit events which was causing compatibility issues with the io.containerd.kata.v2 runtime.

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

@corhere corhere added this to the 23.0.1 milestone Jan 31, 2023
@corhere 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 corhere force-pushed the backport-23.0/fix-kata-exec-exit branch from 19105c7 to 975bdb2 Compare January 31, 2023 17:15
@corhere corhere marked this pull request as ready for review January 31, 2023 17:15
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
Copy link
Member

@AkihiroSuda ptal 🤗

@neersighted neersighted merged commit bacf32d into moby:23.0 Feb 6, 2023
@corhere corhere deleted the backport-23.0/fix-kata-exec-exit branch January 18, 2024 20:22
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.

None yet

4 participants