Bug 983014

Summary: Unnecessary message shows when start mongodb again or restart it from stop
Product: OpenShift Online Reporter: Lei Zhang <lzhang>
Component: ContainersAssignee: Jhon Honce <jhonce>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: xtian, yadu
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-29 12:48:05 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 Lei Zhang 2013-07-10 09:52:49 UTC
Description of problem:
Given a app embeded with mongodb(e.g myruby18), execue "rhc cartridge start -a myruby18 -c mongodb-2.2" from running status, or execute "rhc cartridge restart -a myruby18 -c mongodb-2.2" from stop status. Unnecessary message like "MongoDB already..." shows. For mysql and postgresql work well.

[rayzhang@rayzhang Work]$ rhc cartridge status -a myruby18 -c mongodb-2.2
RESULT:
MongoDB is running
[rayzhang@rayzhang Work]$ rhc cartridge start -a myruby18 -c mongodb-2.2
Starting mongodb-2.2 ... done
MongoDB already running
[rayzhang@rayzhang Work]$ rhc cartridge stop -a myruby18 -c mongodb-2.2
Stopping mongodb-2.2 ... done
[rayzhang@rayzhang Work]$ rhc cartridge restart -a myruby18 -c mongodb-2.2
Restarting mongodb-2.2 ... done
MongoDB already stopped

Version-Release number of selected component (if applicable):
INT(devenv_3470)
rhc-1.11.3.gem

How reproducible:
always

Steps to Reproduce:
1. Start cartridge when it is running.
   . rhc cartridge start -a myruby18 -c mongodb-2.2
   . rhc cartridge start -a myruby18 -c mongodb-2.2
2. Restart cartridge when it is stop.
   . rhc cartridge stop -a myruby18 -c mongodb-2.2
   . rhc cartridge restart -a myruby18 -c mongodb-2.2

Actual results:
Unnecessary message like "MongoDB already ..." shows. 

Expected results:
No unnecessary message should display, except "... mongodb-2.2 ... done"

Additional info:

Comment 1 Clayton Coleman 2013-07-10 15:31:15 UTC
MongoDB is returning a client_result in these cases, which is not necessary.  The UI is showing client result messages.

Given that the information doesn't help the user materially, there's no reason to return it, and MongoDB should be consistent with PostgreSQL and MySQL

Comment 2 Yan Du 2013-08-09 08:01:57 UTC
test on devenv_3632, issue can be reproduced with restapi

after stop mongodb, then try to restart by restapi, will got below message in result:

      <severity>info</severity>
      <text>Added restart on mongodb-2.2 for application j2</text>
      <exit-code>0</exit-code>
      <field nil="true"></field>
    </message>
    <message>
      <severity>result</severity>
      <text>MongoDB already stopped
</text>
      <exit-code>0</exit-code>
      <field nil="true"></field>
    </message>
  </messages>
  <version>1.6</version>
  <api-version>1.6</api-version>

Comment 3 Jhon Honce 2013-08-12 23:59:09 UTC
Fixed in https://github.com/openshift/origin-server/pull/3337

Comment 4 Lei Zhang 2013-08-15 05:22:51 UTC
Retest on devenv_3653, this issue still exists, when I start mongodb again from start status or restart from stop status, the unnecessary message shows "MongoDB already ..."

[lijun@rayzhang Work]$ rhc cartridge start -a myruby18 -c mysql-5.1
Starting mysql-5.1 ... done
[lijun@rayzhang Work]$ rhc cartridge start -a myruby18 -c mongodb-2.2
Starting mongodb-2.2 ... done

MongoDB already running
[lijun@rayzhang Work]$ rhc cartridge stop -a myruby18 -c mongodb-2.2
Stopping mongodb-2.2 ... done
[lijun@rayzhang Work]$ rhc cartridge restart -a myruby18 -c mongodb-2.2
Restarting mongodb-2.2 ... done

MongoDB already stopped

Comment 5 Jhon Honce 2013-08-15 17:29:01 UTC
Using devenv_3656 I was not able recreate this issue.

# rhc cartridge stop mongodb-2.2 -a perl001 
Stopping mongodb-2.2 ... done
# rhc cartridge restart mongodb-2.2 -a perl001 
Restarting mongodb-2.2 ... done

Comment 6 Lei Zhang 2013-08-16 01:38:08 UTC
Verified on devenv_3658.

[rayzhang@rayzhang Work]$ rhc cartridge start -a myruby18 -c mongodb-2.2
Starting mongodb-2.2 ... done
[rayzhang@rayzhang Work]$ rhc cartridge start -a myruby18 -c mongodb-2.2
Starting mongodb-2.2 ... done
[rayzhang@rayzhang Work]$ rhc cartridge stop -a myruby18 -c mongodb-2.2
Stopping mongodb-2.2 ... done
[rayzhang@rayzhang Work]$ rhc cartridge restart -a myruby18 -c mongodb-2.2
Restarting mongodb-2.2 ... done