Bug 1186066

Summary: The docker stop operation doesn't work with --pid=host containers containing multiple processes
Product: Red Hat Enterprise Linux 7 Reporter: Steven Dake <sdake>
Component: dockerAssignee: Daniel Walsh <dwalsh>
Status: CLOSED ERRATA QA Contact: atomic-bugs <atomic-bugs>
Severity: high Docs Contact:
Priority: urgent    
Version: 7.2CC: jkrieger, lsm5, lsu, steven.dake
Target Milestone: rcKeywords: Extras
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-12 15:15:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1186007    

Description Steven Dake 2015-01-26 23:46:45 UTC
Description of problem:
docker stop blocks and fails to stop all processes in the container.

Version-Release number of selected component (if applicable):
1.4.1-beta2

How reproducible:
100%

Steps to Reproduce:
Make sure libvirtd, nova-compute, nova-network, and virtlockd is not running on the host.  If they are, disable them and reboot.

1. git clone https://github.com/sdake/compute-upgrade.git
2. cd compute-upgrade/tools
3. ./start-compute
4. Use docker ps to obtain docker container id for the nova-compute container
5. use docker stop <CONTAINER_ID> where container id is the container id from step #4

Actual results:
The operation blocks
killall -9 libvirtd
killall -9 virtlockd

This will unblock the docker stop operation

Expected results:
docker stop operation should terminate the libvirtd and virtlockd process and return within a few seconds.

Additional info:

Comment 1 Steven Dake 2015-01-26 23:48:57 UTC
Upstream issue tracker:

https://github.com/docker/docker/issues/10303

Comment 2 Steven Dake 2015-01-26 23:50:20 UTC
Cherry-pick of upstream patch that has been verified to resolve the problem:

https://github.com/rhatdan/docker/commit/0b4cade8b81cf8980977b5d353d7e6a0c08838b7

Comment 4 Daniel Walsh 2015-01-27 14:48:44 UTC
We have a build ready to go with this fix, but need the goahead on building a new package.

Comment 5 Daniel Walsh 2015-01-30 19:28:55 UTC
Fixed in 
docker-1.4.1-37.el7.x86_64.rpm

Comment 8 Steven Dake 2015-02-07 13:46:54 UTC
Daniel,

Any chance you could backport the latest rhel docker to fedora 21?  There is no --pid=host feature which would be nice for testing OpenStack upgrades.

Regards
-steve

Comment 9 Daniel Walsh 2015-02-09 10:25:18 UTC
That fix should be in docker-1.5 which I believe will be released tomorrow by docker. As soon as we get a released version we will update fedora 21 and Rawhide.  Will probably update f20 also.

Comment 11 Luwen Su 2016-05-01 08:10:59 UTC
This should work fine in docker-1.9.1-38.el7.x86_64, move to verified

# docker ps
CONTAINER ID        IMAGE                           COMMAND             CREATED             STATUS              PORTS               NAMES
de946711322b        sdake/fedora-rdo-nova-compute   "/start.sh"         32 seconds ago      Up 14 seconds                           cocky_lichterman
0f60869bd76e        sdake/fedora-rdo-nova-libvirt   "/start.sh"         45 seconds ago      Up 32 seconds                           focused_swirles
10d36abd5fa2        sdake/fedora-rdo-nova-network   "/start.sh"         49 seconds ago      Up 45 seconds                           berserk_wescoff
[root@dhcp-0-137 ~]# docker stop de946711322b
de946711322b

Comment 13 errata-xmlrpc 2016-05-12 15:15:50 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2016-1034.html