Bug 1130362 - app-stop can not stop all process in pyhton app with 'app.py' after start it twice
Summary: app-stop can not stop all process in pyhton app with 'app.py' after start it...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Image
Version: 2.1.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: ---
Assignee: Brenton Leanhardt
QA Contact: libra bugs
URL:
Whiteboard:
Depends On: 1114477
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-15 03:16 UTC by Ma xiaoqiang
Modified: 2016-07-04 00:44 UTC (History)
7 users (show)

Fixed In Version: openshift-origin-cartridge-python-1.23.4.7-1
Doc Type: Bug Fix
Doc Text:
A race condition in the Python cartridge's start method caused the pid file to be written incorrectly in certain situations. This could lead to problems when stopping applications. This bug fix updates the Python cartridge to address the race condition, and the issue no longer occurs as a result. After applying this fix, a cartridge migration is required.
Clone Of:
Environment:
Last Closed: 2014-09-11 20:06:43 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1183 normal SHIPPED_LIVE Red Hat OpenShift Enterprise 2.1.6 bug fix and enhancement update 2014-09-12 00:06:21 UTC

Description Ma xiaoqiang 2014-08-15 03:16:12 UTC
Description of problem:
When file 'app.py' exists, the stop action can't kill the 'python app.py' process after start it twice.

Version-Release number of selected component (if applicable):
puddle [2.1.z/2014-08-13.1]

How reproducible:
100%

Steps to Reproduce:
1. Create a pyhon app
#rhc app create ajeamkpi python-3.3 mongodb-2.4 --from-code https://github.com/openshift-quickstart/Bottle-Python3-quickstart 
2.Start the app twice
#rhc app start ajeamkpi
3. Stop the app
#rhc app stop ajeamkpi
4.access the app

Actual results:
The app is still accessible 

Expected results:
Can not access the app

Additional info:
vim python/usr/versions/3.3/bin/control 
function start_app()
...
    rm -f $LOGPIPE && mkfifo $LOGPIPE
    /usr/bin/logshifter -tag python < $LOGPIPE &
    nohup python -u app.py &> $LOGPIPE &
    if [ "$?" == "0" ]; then
      echo $! > $OPENSHIFT_PYTHON_DIR/run/appserver.pid
    else
These code only change the pid in $OPENSHIFT_PYTHON_DIR/run/appserver.pid when start the app for the second time

Comment 1 Luke Meyer 2014-08-15 13:20:21 UTC
This does not appear to happen upstream. I suspect it was addressed by the PR in bug 1114477.

Comment 2 Brenton Leanhardt 2014-08-26 00:46:30 UTC
Upstream commit:

commit 4a567c49eb6a1fae6b11eee9b82fd477fddd1ca7
Author: jhadvig <jhadvig@redhat.com>
Date:   Mon Jun 30 16:12:03 2014 +0200

    Bug 1114477: Incorrect pid written into appserver.pid upon python cartridge start action

Comment 5 Ma xiaoqiang 2014-08-26 05:19:58 UTC
Check on puddle [2.1.z/2014-08-25.2]

1. Create a pyhon app
#rhc app create ajeamkpi python-3.3 mongodb-2.4 --from-code https://github.com/openshift-quickstart/Bottle-Python3-quickstart 
2.Start the app twice
#rhc app start ajeamkpi
3. Stop the app
#rhc app stop ajeamkpi
4. Access the app
The app is not accessible
5. Start the app, access it
The app is accessible

Comment 7 errata-xmlrpc 2014-09-11 20:06:43 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-1183.html


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