Bug 1116817

Summary: multiple nodejs processes running in a gear
Product: OpenShift Container Platform Reporter: Brenton Leanhardt <bleanhar>
Component: ImageStreamsAssignee: Luke Meyer <lmeyer>
Status: CLOSED ERRATA QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.1.0CC: adellape, agrimm, anli, bparees, dmcphers, gpei, jialiu, jokerman, libra-bugs, libra-onpremise-devel, lmeyer, mfojtik, mmccomas, wzheng
Target Milestone: ---Keywords: Upstream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openshift-origin-cartridge-nodejs-1.24.3.5-1.el6op Doc Type: Bug Fix
Doc Text:
Under certain race conditions or user actions, it was possible for multiple Node.js supervisor processes to be running for a Node.js cartridge. Because only one process could bind to the port, others would die, resulting in the supervisor continuously retrying to start them and consuming all of the gear's CPU. In addition to now checking whether a pidfile exists for another Node.js instance in the gear, this bug fix updates the start up logic to also check whether another supervisor or child is running before starting another. As a result, accidental second invocations of the supervisor starting now correctly exit. The oo-admin-upgrade command is required to upgrade existing gears after applying this fix. See the Solution section in the errata advisory for full details.
Story Points: ---
Clone Of: 1077353 Environment:
Last Closed: 2014-08-04 13:27:38 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:
Bug Depends On: 1077353    
Bug Blocks:    

Comment 4 Anping Li 2014-07-15 04:28:52 UTC
erified and pass on puddle-2-1-2014-07-14. 
After restart gears, only there is only one nodejs process.

[njs-hanli1dom.example.com run]\> ps -ef
UID        PID  PPID  C STIME TTY          TIME CMD
3861      4795  4784  0 00:24 ?        00:00:00 sshd: 53c4a0bd6892df587f000005@pts/1
3861      4796  4795  0 00:24 pts/1    00:00:00 /bin/bash --init-file /usr/bin/rhcsh -i
3861      5040  4796  0 00:24 pts/1    00:00:00 ps -ef
3861     11122     1  0 Jul14 ?        00:00:00 node /opt/rh/nodejs010/root/usr/bin/supervisor -e
3861     11123     1  0 Jul14 ?        00:00:00 /usr/bin/logshifter -tag nodejs
3861     11168 11122  0 Jul14 ?        00:00:00 node server.js
[njs-hanli1dom.example.com run]\> rm cartridge.pid 
[njs-hanli1dom.example.com run]\> gear restart
Cart to restart?
1. nodejs-0.10
?  1
Stopping NodeJS cartridge
Tue Jul 15 2014 00:24:35 GMT-0400 (EDT): Stopping application 'njs' ...
Tue Jul 15 2014 00:24:35 GMT-0400 (EDT): Stopped Node application 'njs'
Starting NodeJS cartridge
Tue Jul 15 2014 00:24:35 GMT-0400 (EDT): Starting application 'njs' ...
[njs-hanli1dom.example.com run]\> ps -ef
UID        PID  PPID  C STIME TTY          TIME CMD
3861      4795  4784  0 00:24 ?        00:00:00 sshd: 53c4a0bd6892df587f000005@pts/1
3861      4796  4795  0 00:24 pts/1    00:00:00 /bin/bash --init-file /usr/bin/rhcsh -i
3861      5361     1  1 00:24 pts/1    00:00:00 node /opt/rh/nodejs010/root/usr/bin/supervisor -e
3861      5362     1  0 00:24 pts/1    00:00:00 /usr/bin/logshifter -tag nodejs
3861      5404  5361  3 00:24 pts/1    00:00:00 node server.js
3861      5420  4796  0 00:24 pts/1    00:00:00 ps -ef

Comment 6 errata-xmlrpc 2014-08-04 13:27:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-0999.html