Bug 1124022 - oo-broker clean-up code is unreliable
Summary: oo-broker clean-up code is unreliable
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Pod
Version: 2.x
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Abhishek Gupta
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-28 20:31 UTC by Miciah Dashiel Butler Masters
Modified: 2015-05-15 00:29 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-10 00:49:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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 ~]#


Note You need to log in before you can comment on or make changes to this bug.