Bug 1118717

Summary: [JBossFuse]Should check whether java process exists when stop a stopped fuse app
Product: OpenShift Container Platform Reporter: xjia <xjia>
Component: FuseAssignee: Kurt T Stam <kurt.stam>
Status: CLOSED WONTFIX QA Contact: David Simansky <dsimansk>
Severity: medium Docs Contact:
Priority: low    
Version: 2.2.0CC: aileenc, janstey, xtian
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: 2017-05-31 18:22:11 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:

Description xjia 2014-07-11 10:33:27 UTC
Description of problem:
Create a fuse app and stop it. Stop this app again, check /var/log/openshift/node/platform.log on node.
<--snip-->
cat: /var/lib/openshift/53bfb1eb41312e7c5300038a/fuse//container/instances/instance.properties: No such file or directory\nCan't connect to the container. The container is not running.\nERROR: List of process IDs must follow -p.
<--snip-->

Check the source code : /usr/libexec/openshift/cartridges/fuse/bin/control 
function stop() {
    PID=`cat $FUSE_PID_FILE | grep "item.0.pid" | awk -F " = " '{print $2}'`   ==>Should check PID is valid or invalid
    ${FUSE_BIN_DIR}/stop
    for i in {1..20};
        do
            if ps -p $PID > /dev/null; then
                echo "Fabric has been successfully stopped"
                rm $FUSE_PID_FILE
                break
            else
                sleep 3
            fi
        done
    client_result "Stopped Fuse cart"
}

Version-Release number of selected component (if applicable):
fuse-openshift-cartridge-openshift-enterprise-rpm-6.1.0.redhat.385-2-fc18.noarch.rpm
2.1.z/2014-07-07.1

How reproducible:
always

Steps to Reproduce:
1. rhc app create fuse fuse-1.0.0
2. rhc app stop fuse
3. rhc app stop fuse

Actual results:
Step 3:
in /var/log/openshift/node/platform.log file:
<--snip-->
cat: /var/lib/openshift/53bfb1eb41312e7c5300038a/fuse//container/instances/instance.properties: No such file or directory\nCan't connect to the container. The container is not running.\nERROR: List of process IDs must follow -p.
<--snip-->

Expected results:
Step 3:
No such error in /var/log/openshift/node/platform.log file

Additional info

Comment 2 Kurt T Stam 2014-07-14 20:32:14 UTC
The error in the log says that the instance.properties does not exist (presumably because the instance is already down). It does check if the process is still up after that 'if ps -p $PID > /dev/null;'. I think we should break the first line 'PID=`cat $FUSE_PID_FILE ...' up to make sure this file exists and stop if it does not.

Comment 4 Jonathan Anstey 2014-07-16 01:38:45 UTC
If we don't need any more product fixes, the next cartridge version will be 6.1.0.redhat.385-3. Gonna wait until we have a few more fixes in place before building another set of RPMs though.

Comment 5 xjia 2014-07-29 09:45:42 UTC
Version:
openshift-origin-cartridge-fuse-6.1.0.redhat.387-3.el6op.noarch.rpm

Sorry, This issue is still existing. 
Could you help check code in /usr/libexec/openshift/cartridges/fuse/bin/control ?

function stop() {
    if [ -f $AMQ_PID_FILE ]; then
        PID=`cat $FUSE_PID_FILE | grep "item.0.pid" | awk -F " = " '{print $2}'`

AMQ_PID_FILE is a mistake. It should be "FUSE_PID_FILE" instead.

Comment 6 Kurt T Stam 2014-07-31 13:28:20 UTC
Oops nice copy-paste error there. Fixed in:

https://github.com/jboss-fuse/fuse-openshift-cartridge/commit/62619a02191837a4d11f8537db37863a5faa8f0e

in both master and openshift-enterprise-6.1 branch.

Comment 7 xjia 2014-08-15 09:18:00 UTC
Could you move this bug "ON_QA" ? Thanks
Version:
openshift-origin-cartridge-fuse-6.1.0.redhat.389-1.el6op.noarch.rpm
openshift-origin-cartridge-amq-6.1.0.redhat.389-1.el6op.noarch.rpm

Step:
[root@broker ~]# rhc app stop fuse
RESULT:
fuse stopped
[root@broker ~]# rhc app stop amq
RESULT:
amq stopped
[root@broker ~]# rhc app stop amq
RESULT:
amq stopped
[root@broker ~]# rhc app stop amq
RESULT:
amq stopped

Comment 8 xjia 2014-08-15 09:51:29 UTC
According to comment #7, verify this bug.

Comment 10 Eric Paris 2017-05-31 18:22:11 UTC
We apologize, however, we do not plan to address this report at this time. The majority of our active development is for the v3 version of OpenShift. If you would like for Red Hat to reconsider this decision, please reach out to your support representative. We are very sorry for any inconvenience this may cause.