Bug 964089 - check_cgroup_procs function in oo-accept-node need to be updated
check_cgroup_procs function in oo-accept-node need to be updated
Status: CLOSED CURRENTRELEASE
Product: OpenShift Container Platform
Classification: Red Hat
Component: Containers (Show other bugs)
1.2.0
Unspecified Unspecified
high Severity high
: ---
: ---
Assigned To: Jason DeTiberus
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-17 04:31 EDT by Johnny Liu
Modified: 2017-03-08 12 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-28 11:47:01 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Johnny Liu 2013-05-17 04:31:58 EDT
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 13:53:00 EDT
https://github.com/openshift/origin-server/pull/2553
Comment 3 openshift-github-bot 2013-05-21 11:28:13 EDT
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-23 23:06:10 EDT
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 11:47:01 EDT
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.