Bug 964089 - check_cgroup_procs function in oo-accept-node need to be updated
Summary: check_cgroup_procs function in oo-accept-node need to be updated
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Containers
Version: 1.2.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: Jason DeTiberus
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-17 08:31 UTC by Johnny Liu
Modified: 2017-03-08 17:35 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-06-28 15:47:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Johnny Liu 2013-05-17 08:31:58 UTC
Description of problem:
Check_cgroup_procs function in oo-accept-node, found this two issues:

1). This function only check the processes running as uid of 4 length according to the following line:
all_user_procs = %x[/bin/ps -ef | /bin/egrep "^[0-9]{4}"].split("\n")
Currently only gears deployed in district will run as uid of 4 length, for the gears deployed in non-district will run as uid of 3 length, that means if district is not created, oo-accept-node will not check cgroups processes.

2). Create district, create applications, e.g:
[root@node2 ~]# /bin/ps -ef | /bin/egrep "^[0-9]{4}"
<--snip-->
2199      2174     1  0 May16 ?        00:00:00 /usr/sbin/httpd -C Include /var/lib/openshift/51949668ab808a1f510000dd/perl//etc/conf.d/*.conf -f /var/lib/openshift/51949668ab808a1f510000dd/perl//etc/conf/httpd_nolog.conf -k start
2199      2175  2174  0 May16 ?        00:00:00 /usr/sbin/rotatelogs /var/lib/openshift/51949668ab808a1f510000dd/perl//logs/error_log-%Y%m%d-%H%M%S-%Z 86400
2199      2176  2174  0 May16 ?        00:00:00 /usr/sbin/rotatelogs /var/lib/openshift/51949668ab808a1f510000dd/perl//logs/access_log-%Y%m%d-%H%M%S-%Z 86400
2199      2185  2174  0 May16 ?        00:00:00 /usr/sbin/httpd -C Include /var/lib/openshift/51949668ab808a1f510000dd/perl//etc/conf.d/*.conf -f /var/lib/openshift/51949668ab808a1f5100
<--snip-->

Run oo-accept-node, get the following error:
[root@node2 ~]# oo-accept-node 
/usr/sbin/oo-accept-node:366:in `-': can't convert nil into Array (TypeError)
	from /usr/sbin/oo-accept-node:366:in `block in check_cgroup_procs'
	from /usr/sbin/oo-accept-node:365:in `each'
	from /usr/sbin/oo-accept-node:365:in `check_cgroup_procs'
	from /usr/sbin/oo-accept-node:654:in `<main>'

Check the code, found "/cgroup/all/openshift/*/cgroup.procs" does not exist now, that will make cgroup_procs[uuid] to be nil, the cgroup path should be corrected to "/cgroup/memory/openshift/*/cgroup.procs".


Version-Release number of selected component (if applicable):
1.2/2013-05-16.1

How reproducible:
Always

Steps to Reproduce:
1.Set up env using installation script
2.Create district
3.Create app
4.Run oo-accept-node command
  
Actual results:
[root@node2 ~]# oo-accept-node 
/usr/sbin/oo-accept-node:366:in `-': can't convert nil into Array (TypeError)
	from /usr/sbin/oo-accept-node:366:in `block in check_cgroup_procs'
	from /usr/sbin/oo-accept-node:365:in `each'
	from /usr/sbin/oo-accept-node:365:in `check_cgroup_procs'
	from /usr/sbin/oo-accept-node:654:in `<main>'

Expected results:
No error is thrown out.

Additional info:

Comment 2 Jason DeTiberus 2013-05-20 17:53:00 UTC
https://github.com/openshift/origin-server/pull/2553

Comment 3 openshift-github-bot 2013-05-21 15:28:13 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/daade4cce2352dc54c2cb34e60b016639efee248
<oo-accept-node> Bug 964089 - Fix check_cgroup_procs

https://bugzilla.redhat.com/show_bug.cgi?id=964089

Check for UIDs that are between GEAR_MIN_UID and GEAR_MAX_UID

Support for mounting cgroup controllers either under /cgroup/all or
/cgroup/<controller>

Comment 4 Johnny Liu 2013-05-24 03:06:10 UTC
Verified this bug with openshift-origin-node-util-1.9.4-1.git.0.4755be3.el6op.noarch, and PASS.

Comment 5 Luke Meyer 2013-06-28 15:47:01 UTC
Closing all bugs introduced, fixed, and verified during 1.2 release work (thus never shipped).


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