Bug 1160934 - "oo-admin-ctl-gears stopgear" failed to stop idled gear
Summary: "oo-admin-ctl-gears stopgear" failed to stop idled gear
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Containers
Version: 2.2.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Vu Dinh
QA Contact: Anping Li
URL:
Whiteboard:
Depends On: 1140544
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-06 02:35 UTC by wangyanyan
Modified: 2016-03-22 16:51 UTC (History)
12 users (show)

Fixed In Version: rubygem-openshift-origin-node-1.38.5.2-1.el6op
Doc Type: Bug Fix
Doc Text:
Cause: The oo-admin-ctl-gears command doesn't update the current state of the gear after it successfully stopped an idled gear. Consequence: The gear's status remains as "idled" even though it was stopped successfully. Fix: The command now changes the status of the gear from "idled" to "stopped" if the gear is stopped successfully. Result: The correct status "stopped" of the gear is now displayed instead of the previous "idled" status.
Clone Of: 1140544
Environment:
Last Closed: 2016-03-22 16:51:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:0489 0 normal SHIPPED_LIVE Important: Red Hat OpenShift Enterprise 2.2.9 security, bug fix, and enhancement update 2016-03-22 20:49:04 UTC

Description wangyanyan 2014-11-06 02:35:20 UTC
Enterprise env: ose 2.2/2014-10-29.1

Action:
1.oo-admin-ctl-gears idlegear 545998e6e5fed5d568000113
2.In client: rhc app show pythons --gears
3.oo-admin-ctl-gears stopgear 545998e6e5fed5d568000113
4.In client: rhc app show pythons --gears
5.In client: rhc app stop pythons
6.In client: rhc app show pythons --gears

Actual results:
2.# rhc app show pythons --gears
ID                       State Cartridges             Size  SSH URL
------------------------ ----- ---------------------- ----- --------------------------------------------------------------
545998e6e5fed5d568000113 idle  python-3.3 haproxy-1.4 small 545998e6e5fed5d568000113.com.cn
3.# oo-admin-ctl-gears stopgear  545998e6e5fed5d568000113
Stopping gear 545998e6e5fed5d568000113 ... [  OK ]
4.# rhc app show pythons --gears
ID                       State Cartridges             Size  SSH URL
------------------------ ----- ---------------------- ----- --------------------------------------------------------------
545998e6e5fed5d568000113 idle  python-3.3 haproxy-1.4 small 545998e6e5fed5d568000113.com.cn
5.# rhc app stop pythons
RESULT:
pythons stopped
6.# rhc app show pythons --gears
ID                       State   Cartridges             Size  SSH URL
------------------------ ------- ---------------------- ----- --------------------------------------------------------------
545998e6e5fed5d568000113 stopped python-3.3 haproxy-1.4 small 545998e6e5fed5d568000113.com.cn

Expect results:
3.# oo-admin-ctl-gears stopgear  545998e6e5fed5d568000113
Stopping gear 545998e6e5fed5d568000113 ... [  OK ]
4.# rhc app show pythons --gears
ID                       State Cartridges             Size  SSH URL
------------------------ ----- ---------------------- ----- --------------------------------------------------------------
545998e6e5fed5d568000113 stoped  python-3.3 haproxy-1.4 small 545998e6e5fed5d568000113.com.cn
 
+++ This bug was initially created as a clone of Bug #1140544 +++

Description of problem:
Using "oo-admin-ctl-gears stopgear" to stop a gear which is in idle state,
while the output show stopped the gear successfully, the gear is still in idle state actually.

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

How reproducible:
always

Steps to Reproduce:
1.Create an app of any type.
  # rhc create-app appname <cart>
2.Idle the gear of above app.
  # oo-admin-ctl-gears idlegear <gear-uuid>
3.Check the app/gear state
  # rhc show-app appname --state
  # oo-devel-node app-state-show -c <gear-uuid>
4.Stop the gear
  # oo-admin-ctl-gears stopgear <gear-uuid>
5.Check the app/gear state
  # rhc show-app appname --state
  # oo-devel-node app-state-show -c <gear-uuid>

Actual results:
Step 3:
# rhc app show diy --state
Cartridge diy-0.1 is idle
# oo-devel-node app-state-show -c 541176aa96a860a03d000543
idle

Step 4:
# oo-admin-ctl-gears stopgear 541176aa96a860a03d000543
Stopping gear 541176aa96a860a03d000543 ... [  OK ]

Step 5:
# rhc app show diy --state
Cartridge diy-0.1 is idle
# oo-devel-node app-state-show -c 541176aa96a860a03d000543
idle

Expected results:
The gear should be stopped after step 4.

Additional info:
Using "rhc stop-app" to stop an app whose gear in idle state, then the gear will be show stopped.

Comment 3 openshift-github-bot 2015-12-16 17:38:08 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/f557bd3ce2b05a6380a9650acd3f1db5fd67d772
Bug 1160934 - "oo-admin-ctl-gears stopgear" failed to stop idled gear

During the 'idlegear' operation, the gear in fact is stopped but the
state value is changed to 'idle'. Then, subsequently, when 'stopgear'
operation is excuted, the cartridge doesn't perform any extra works
as the gear is already stopped. However, the state is not modified
to 'stopped' due to lacking of explicit state change in application
container itself.

This commit will add explicit state change to application container
to ensuring the state is changed accordingly.

Bug 1160934
Link <https://bugzilla.redhat.com/show_bug.cgi?id=1160934>

Signed-off-by: Vu Dinh <vdinh>

Comment 4 Anping Li 2015-12-21 01:54:40 UTC
Could you generate a OSE2.2 puddle?  So QE can test the fix?

Comment 5 Vu Dinh 2015-12-21 16:59:00 UTC
Hi Anping,

This bug was prematurely set to ON_QA. Sorry about that. There will be a puddle coming out for the next release. I will set this back to QE when that time comes.

Thanks!

Comment 10 Anping Li 2016-02-26 07:04:49 UTC
Verified and pass.


[root@node2 ~]# oo-admin-ctl-gears  idlegear anlidom-sphp-1
Idling gear anlidom-sphp-1 ... [ OK ]
[root@node2 ~]# oo-admin-ctl-gears  stopgear anlidom-sphp-1
Stopping gear anlidom-sphp-1 ... [ OK ]
[anli@broker ~]$ rhc app show sphp --gears
ID             State   Cartridges          Size  SSH URL
-------------- ------- ------------------- ----- ---------------------------------------------
anlidom-sphp-1 stopped haproxy-1.4 php-5.3 small anlidom-sphp-1.com.cn

Comment 12 errata-xmlrpc 2016-03-22 16:51:00 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.

https://rhn.redhat.com/errata/RHSA-2016-0489.html


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