Wait for container exit before forcing handler
Wait for container exit before forcing handler

This code assumes that we missed an exit event since the container is
still marked as running in Docker but attempts to signal the process in
containerd returns a "process not found" error.

There is a case where the event wasn't missed, just that it hasn't been
processed yet.

This change tries to work around that possibility by waiting to see if
the container is eventually marked as stopped. It uses the container's
configured stop timeout for this.

Signed-off-by: Brian Goff <dc73d0991b982a8303e713ef531a313af77e242a@gmail.com>

dims/docker,justincormack/docker,kojiromike/docker,estesp/docker,yosifkit/docker,nawawi/docker,kojiromike/docker,Mokolea/docker,flavio/docker,bearstech/moby,ibuildthecloud/docker,nalind/docker,nalind/docker,AkihiroSuda/docker,paralin/docker,gnailuy/docker,moul/docker,flavio/docker,vdemeester/docker,justincormack/docker,estesp/docker,moul/docker,gnailuy/docker,AkihiroSuda/docker,thaJeztah/docker,gnailuy/docker,gnailuy/docker,moby/moby,moul/docker,trebonian/docker,flavio/docker,ibuildthecloud/docker,konstruktoid/docker-upstream,mahak/docker,docker/docker,moby/moby,jimjag/docker,cpuguy83/docker,dims/docker,konstruktoid/docker-upstream,konstruktoid/docker-1,nawawi/docker,estesp/docker,jimjag/docker,cpuguy83/docker,Mokolea/docker,paralin/docker,justincormack/docker,docker/docker,mahak/docker,Ramzec/docker,mahak/docker,jimjag/docker,konstruktoid/docker-1,konstruktoid/docker-upstream,djs55/docker,jimjag/docker,nalind/docker,cpuguy83/docker,paralin/docker,yosifkit/docker,djs55/docker,mahak/docker,Ramzec/docker,vdemeester/docker,konstruktoid/docker-upstream,thaJeztah/docker,ibuildthecloud/docker,bearstech/moby,docker/docker,vdemeester/docker,jameszhan/docker,yosifkit/docker,AkihiroSuda/docker,jameszhan/docker,Mokolea/docker,Ramzec/docker,dims/docker,djs55/docker,trebonian/docker,konstruktoid/docker-1,nawawi/docker,bearstech/moby,ibuildthecloud/docker,paralin/docker,cpuguy83/docker,kojiromike/docker,Ramzec/docker,moby/moby,jameszhan/docker,thaJeztah/docker,Mokolea/docker,ibuildthecloud/docker,bearstech/moby,flavio/docker,moby/moby,AkihiroSuda/docker,jthelin/docker,thaJeztah/docker,yosifkit/docker,moul/docker,nalind/docker,trebonian/docker,trebonian/docker,nawawi/docker,jthelin/docker