Bug 1004740

Summary: Hot_deploy is not working for nodejs-0.6 and nodejs-0.10 app
Product: OpenShift Online Reporter: Yan Du <yadu>
Component: ContainersAssignee: Fotios Lindiakos <fotios>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: fotios, jkeck
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-09-19 16:49:22 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:

Description Yan Du 2013-09-05 11:39:42 UTC
Description of problem:
create a nodejs app and add hot_deploy, after push, the PID changed


Version-Release number of selected component (if applicable):
devenv_3745


How reproducible:
Always



Steps to Reproduce:
1. create a nodejs app
rhc app create nd10 nodejs-0.10
2. in app repo, add hot_deploy and change something in index.html, then git push
touch .openshift/markers/hot_deploy
3. check the change take effect
4. change something again and git push
5. check the change and the PID



Actual results:
step 2.

[root@Daphne nd10]# touch .openshift/markers/hot_deploy
[root@Daphne nd10]# vim index.html 
[root@Daphne nd10]# git add .; git commit -amp; git push
[master ee22231] p
 Committer: root <root@Daphne.(none)>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
 1 files changed, 1 insertions(+), 1 deletions(-)
 create mode 100644 .openshift/markers/hot_deploy
Counting objects: 9, done.
<-------------snip---------------------------------->
remote: Not starting cartridge nodejs because hot deploy is enabled
remote: hot_deploy marker found. Switching to using supervisor. Subsequent pushes won't require restart until the marker is removed.
remote: Stopping NodeJS cartridge
remote: Starting NodeJS cartridge
To ssh://52286342b2636ebd440001d3.rhcloud.com/~/git/nd10.git/
   c003025..ee22231  master -> master
  
 
step4:  

[root@Daphne nd10]# vim index.html 
[root@Daphne nd10]# git add .; git commit -amp; git push
[master 6e27f9b] p
 Committer: root <root@Daphne.(none)>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
 1 files changed, 1 insertions(+), 1 deletions(-)
Counting objects: 5, done.
<------------------------snip--------------------------->
remote: npm info prepublish OpenShift-Sample-App.0
remote: npm info ok 
remote: Starting application nd10
remote: Not starting cartridge nodejs because hot deploy is enabled
remote: hot_deploy marker found. Switching to using supervisor. Subsequent pushes won't require restart until the marker is removed.
remote: Stopping NodeJS cartridge
remote: Starting NodeJS cartridge
To ssh://52286342b2636ebd440001d3.rhcloud.com/~/git/nd10.git/
   ee22231..6e27f9b  master -> master


step5,
the cartridge restarted when git push, and PID for node /opt/rh/nodejs010/root/usr/bin/supervisor changed


Expected results:
should not restart since adding the hot_depoy marker, and the PID will be keep the same ID


Additional info:

Comment 1 Fotios Lindiakos 2013-09-09 15:29:50 UTC
The logic for the NodeJS cart has changed slightly. Now it always uses the supervisor wrapper to launch `node`. When testing with hot_deploy, the main `supervisor` pid should not change, but it will launch a new `node` process.

PR is here and submitting shortly:
https://github.com/openshift/origin-server/pull/3564

Comment 2 Yan Du 2013-09-10 10:43:44 UTC
test devenv_3764, supervisor process PID keep the same ID after push. move the bug to verified.