Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1130362 - app-stop can not stop all process in pyhton app with 'app.py' after start it twice
app-stop can not stop all process in pyhton app with 'app.py' after start it...
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Image (Show other bugs)
2.1.0
Unspecified Unspecified
high Severity medium
: ---
: ---
Assigned To: Brenton Leanhardt
libra bugs
: Upstream
Depends On: 1114477
Blocks:
  Show dependency treegraph
 
Reported: 2014-08-14 23:16 EDT by Ma xiaoqiang
Modified: 2016-07-03 20:44 EDT (History)
7 users (show)

See Also:
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.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-09-11 16:06:43 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)


External Trackers
Tracker 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-11 20:06:21 EDT

  None (edit)
Description Ma xiaoqiang 2014-08-14 23:16:12 EDT
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 09:20:21 EDT
This does not appear to happen upstream. I suspect it was addressed by the PR in bug 1114477.
Comment 2 Brenton Leanhardt 2014-08-25 20:46:30 EDT
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 01:19:58 EDT
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 16:06:43 EDT
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.