1391c5c2fd
CRI-O works well with runc when stopping a container because as soon as the container process returns, it can consider every container resources such as its rootfs as being freed, and it can proceed further by unmounting it. But in case of virtualized runtime such as Clear Containers or Kata Containers, the same rootfs is being mounted into the VM, usually as a device being hotplugged. This means the runtime will need to be triggered after the container process has returned. Particularly, such runtimes should expect a call into "state" in order to realize the container process is not running anymore, and it would trigger the container to be officially stopped, proceeding to the necessary unmounts. The way this can be done from CRI-O, without impacting the case of runc, is to explicitly wait for the container status to be updated into "stopped" after the container process has returned. This way CRI-O will call into "state" as long as it cannot see the container status being updated properly, generating an error after a timeout. Both PollUpdateStatusStopped() and WaitContainerStateStopped() make use of go routines in order to support a timeout definition. They follow the waitContainerStop() approach with chControl. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com> |
||
---|---|---|
.. | ||
apparmor | ||
fixtures | ||
metrics | ||
seccomp | ||
config.go | ||
config_test.go | ||
container_attach.go | ||
container_create.go | ||
container_exec.go | ||
container_execsync.go | ||
container_list.go | ||
container_portforward.go | ||
container_remove.go | ||
container_reopen_log.go | ||
container_start.go | ||
container_stats.go | ||
container_stats_list.go | ||
container_status.go | ||
container_stop.go | ||
container_update_resources.go | ||
container_updateruntimeconfig.go | ||
image_fs_info.go | ||
image_list.go | ||
image_pull.go | ||
image_remove.go | ||
image_status.go | ||
inspect.go | ||
inspect_test.go | ||
naming.go | ||
runtime_status.go | ||
sandbox_list.go | ||
sandbox_network.go | ||
sandbox_remove.go | ||
sandbox_run.go | ||
sandbox_status.go | ||
sandbox_stop.go | ||
secrets.go | ||
secrets_test.go | ||
server.go | ||
utils.go | ||
utils_test.go | ||
version.go |