Bug 1464698 - prevent two miq servers from starting
Summary: prevent two miq servers from starting
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Appliance
Version: 5.6.0
Hardware: All
OS: All
medium
high
Target Milestone: GA
: 5.9.0
Assignee: Gregg Tanzillo
QA Contact: luke couzens
URL:
Whiteboard: appliance
Depends On:
Blocks: 1468612 1478434 1484485
TreeView+ depends on / blocked
 
Reported: 2017-06-24 17:45 UTC by Ryan Spagnola
Modified: 2020-09-10 10:46 UTC (History)
7 users (show)

Fixed In Version: 5.9.0.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1468612 1478434 1484485 (view as bug list)
Environment:
Last Closed: 2018-03-06 15:45:31 UTC
Category: Bug
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Comment 2 Joe Rafaniello 2017-06-28 15:03:14 UTC
After looking at the top_output.log, we found that there were two MIQ Server processes running on the system with their own set of workers running below them.

It appears that manually running evmserver.sh start, outside of using systemctl evmserverd, may have complicated the issue and could be a reason for the two server processes on the same machine.  Nevertheless, the machines were rebooted, and the request was to always use systemd through systemctl to start and stop evmserverd.


  PID  PPID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
19502     1 root      20   0  666920 295924   6752 S   5.4  1.8  39:43.70 MIQ Server
 5899     1 root      20   0  652524 299860   6752 S   3.7  1.8   5672:04 MIQ Server

The multiple servers would cause the workers to constantly try to stop workers and possibly prevent them from successfully exiting.

Comment 5 CFME Bot 2017-07-01 11:06:22 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/9090b3e20967bf2f9fe25047260dce7aa5a0de41

commit 9090b3e20967bf2f9fe25047260dce7aa5a0de41
Author:     Joe Rafaniello <jrafanie>
AuthorDate: Fri Jun 30 16:51:56 2017 -0400
Commit:     Joe Rafaniello <jrafanie>
CommitDate: Fri Jun 30 17:54:33 2017 -0400

    Only remove my process' pidfile.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1464698
    
    at_exit handlers created in the server process are inherited when the
    server forks workers.  As soon as one of these workers exits, this
    at_exit was being run and removing the server's pidfile.  This allowed a
    subsequent rake evm:start or systemctl start evmserverd to fail to
    detect an existing server process, allowing a second MIQ Server to
    start.
    
    We can workaround this by only removing a pidfile that matches my
    Process.pid.

 lib/pid_file.rb           | 2 +-
 spec/lib/pid_file_spec.rb | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Comment 12 luke couzens 2017-10-18 11:24:52 UTC
Verified in 5.9.0.2


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