Bug 964089

Summary: check_cgroup_procs function in oo-accept-node need to be updated
Product: OpenShift Container Platform Reporter: Johnny Liu <jialiu>
Component: ContainersAssignee: Jason DeTiberus <jdetiber>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 1.2.0CC: jdetiber, libra-onpremise-devel
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: 2013-06-28 15:47:01 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 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).