Bug 1112445

Summary: Failed to stop idled app
Product: OpenShift Container Platform Reporter: Brenton Leanhardt <bleanhar>
Component: ContainersAssignee: Brenton Leanhardt <bleanhar>
Status: CLOSED ERRATA QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 2.1.0CC: adellape, anli, chunchen, gpei, jialiu, jokerman, libra-onpremise-devel, mmccomas
Target Milestone: ---Keywords: Upstream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-openshift-origin-node-1.23.9.15-1.el6op Doc Type: Bug Fix
Doc Text:
Due to a bug in the Watchman Gear State plug-in, idled applications could not be properly stopped. This bug fix updates the Gear State plug-in to unidle an application's front end before stopping to ensure the proper final state. As a result, idled applications can now be properly stopped.
Story Points: ---
Clone Of: 1111077 Environment:
Last Closed: 2014-08-26 13:52:39 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: 1111077    
Bug Blocks:    

Description Brenton Leanhardt 2014-06-24 01:44:57 UTC
+++ This bug was initially created as a clone of Bug #1111077 +++

Description of problem:
After stopping idled app, the app still can be accessed.

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

How reproducible:
always

Steps to Reproduce:
1. Create an app
rhc app create crb9 ruby-1.9 --no-git

2. SSH into instance and idle the app
oo-admin-ctl-gears idlegear UUID

3. Stop the idled app and check the app state
rhc app stop crb9
rhc app show crb9 --state

4. Access the app via browser

5. Check the status of app
rhc app show crb9 --state

Actual results:
at step 3: Cartridge ruby-1.9 is stopped
at step 4: the app can be accessed
at step 5: Cartridge ruby-1.9 is started
 
Expected results:
Should stop idled app successfully

Additional info:

--- Additional comment from chunchen on 2014-06-19 04:45:18 EDT ---

it also can be reproduced for "oo-admin-ctl-gears stopgear" command.

Comment 1 Brenton Leanhardt 2014-08-01 13:42:20 UTC
The following commits do _not_ need to be backported:

commit 26053a96424c25b331a135fee4c5424fbbc4c49f
Author: Jhon Honce <jhonce>
Date:   Mon Jun 23 09:43:00 2014 -0700

    Bug 1111077 - Ensure frontend and state in sync
    
    * When stopping an idled application update http frontend configuration

commit bfad149a7bf3625a03fc23c4a50ef1a18efeb9c5
Author: Jhon Honce <jhonce>
Date:   Wed Jun 25 09:25:18 2014 -0700

    Revert "Bug 1111077 - Ensure frontend and state in sync"

Upstream commits:

commit d3834dff3f59cafac545abb5f02982f82c3ce1a7
Author: Jhon Honce <jhonce>
Date:   Fri Jun 27 09:35:02 2014 -0700

    Bug 1111077 - Enforce FrontendHttpServer state to match .state file
    
    * Update GearStatePlugin to enforce stopped state on Frontend
      Http Server configuration

commit 8f1389d6ccb843783d263af1817768a1db05feba
Author: Jhon Honce <jhonce>
Date:   Mon Jun 30 14:01:16 2014 -0700

    Bug 1111077 - Enforce FrontendHttpServer state to match .state file
    
    * Update tests

Comment 4 Anping Li 2014-08-04 05:46:37 UTC
Verified and pass on puddle-2-1-2014-08-01. 


[hanli1@broker ~]$ rhc app show  crb9 --state
Cartridge ruby-1.9 is idle

[hanli1@broker ~]$ rhc app stop crb9 
RESULT:
crb9 stopped


[root@node1 runtime]# tailf .state 
stopped

[hanli1@broker ~]$ curl -s http://crb9-hanli1dom.ose21z.example.com/
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>503 Service Temporarily Unavailable</title>
</head><body>
<h1>Service Temporarily Unavailable</h1>
<p>The server is temporarily unable to service your
request due to maintenance downtime or capacity
problems. Please try again later.</p>
<hr>
<address>Apache/2.2.15 (Red Hat) Server at crb9-hanli1dom.ose21z.example.com Port 80</address>
</body></html>

Comment 6 errata-xmlrpc 2014-08-26 13:52:39 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-1095.html