Bug 1124022

Summary: oo-broker clean-up code is unreliable
Product: OpenShift Online Reporter: Miciah Dashiel Butler Masters <mmasters>
Component: PodAssignee: Abhishek Gupta <abhgupta>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.xCC: fli, jokerman, mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-10 00:49:51 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:

Description Miciah Dashiel Butler Masters 2014-07-28 20:31:31 UTC
Description of problem:

oo-broker's clean-up code is unreliable.  If I hit ctrl-c at the wrong time, oo-broker does not clean up the container or cidfile.


How reproducible:

Racy.


Steps to Reproduce:

1. Start a devenv.

2. Run oo-broker with some command (e.g., an echo or sleep command).

3. Hit ctrl-c at just the wrong time (hitting it a lot, or holding it down, increases the probability of this happening).

4. Run `ls /tmp/openshift`.

5. If there is a file in /tmp/openshift/, run `docker inspect $(< /tmp/openshift/oo-broker-cid_*)`.


Actual results:

At Step 4, the cidfile is still in /tmp/openshift/.

At Step 5, `docker inspect` reveals that the container is still running.


Expected results:

The cidfile and container should both be gone.

Comment 1 Miciah Dashiel Butler Masters 2014-07-28 20:33:35 UTC
PR: https://github.com/openshift/li/pull/2764

Comment 2 openshift-github-bot 2014-07-29 16:35:16 UTC
Commit pushed to master at https://github.com/openshift/li

https://github.com/openshift/li/commit/4229cd1222b35789b63feccdf82e355a7443d43a
oo-broker: improve clean-up code

Use trap EXIT in oo-broker and oo-broker-modify in order to clean up the
cidfile and container more reliably.

This commit fixes bug 1124022.

Comment 3 Fulei Li 2014-07-30 07:16:05 UTC
Verified on devenv_5027 there was not a file in /tmp/openshift/

[root@ip-10-63-162-136 ~]# oo-broker oo-admin-ctl-user -l fli --setmaxgears 20

	from /var/www/openshift/broker/config/environment.rb:14:in `<top (required)>'
	from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
	from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
	from /usr/sbin/oo-admin-ctl-user:645:in `<main>'
^C[root@ip-10-63-162-136 ~]ls /tmp/openshift/
[root@ip-10-63-162-136 ~]#