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

Commits on Jan 31, 2023

  1. daemon: identify container exits by ProcessID

    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 committed Jan 31, 2023
    Configuration menu
    Copy the full SHA
    975bdb2 View commit details
    Browse the repository at this point in the history