cri-o/lib
Sebastien Boeuf 1391c5c2fd crio: Ensure container state is stopped when calling StopContainer()
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>
2018-03-02 14:55:29 -08:00
..
sandbox Add context to net ns symlink removal errors 2018-02-26 10:29:32 -08:00
testdata Change all references to kpod to podman 2018-03-01 04:14:31 -08:00
config.go Enable per pod PID namespace setting 2018-03-02 12:04:02 -05:00
config_test.go libkpod -> lib rename 2017-11-30 17:08:26 +01:00
container.go libkpod -> lib rename 2017-11-30 17:08:26 +01:00
container_server.go Merge pull request #1384 from vbatts/platform-003 2018-03-01 12:42:34 -08:00
container_server_linux.go lib: abstract out sandbox for platforms 2018-02-27 16:16:48 -05:00
container_server_unsupported.go lib: abstract out sandbox for platforms 2018-02-27 16:16:48 -05:00
hooks.go server: fsnotify on hooks 2018-02-19 17:05:37 +01:00
kill.go libkpod -> lib rename 2017-11-30 17:08:26 +01:00
logs.go Change all references to kpod to podman 2018-03-01 04:14:31 -08:00
pause.go libkpod -> lib rename 2017-11-30 17:08:26 +01:00
remove.go libkpod -> lib rename 2017-11-30 17:08:26 +01:00
rename.go Update code for latest k8s 2018-02-21 11:03:56 -08:00
stats.go Add methods for listing and fetching container stats 2018-02-14 08:10:13 -08:00
stop.go crio: Ensure container state is stopped when calling StopContainer() 2018-03-02 14:55:29 -08:00
wait.go libkpod -> lib rename 2017-11-30 17:08:26 +01:00