[SERVER-37493] Powercycle kill_mongod should not fail when calling mongod.stop Created: 05/Oct/18  Updated: 06/Dec/22  Resolved: 01/Nov/18

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Jonathan Abrahams Assignee: Backlog - Server Tooling and Methods (STM) (Inactive)
Resolution: Duplicate Votes: 0
Labels: tig-powercycle
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
duplicates SERVER-37125 Powercycle should ignore a process re... Closed
Assigned Teams:
Server Tooling & Methods
Operating System: ALL
Participants:
Linked BF Score: 26

 Description   

An exception can be raised in this code block, in powertest.py, which can erroneously cause a test failure:

        elif operation == "kill_mongod":
            # Unconditional kill of mongod.
            ret, output = kill_mongod()
            if ret:
                LOGGER.error("kill_mongod failed %s", output)
                return ret
            # Ensure the mongod service is not in a running state.
            mongod.stop(timeout=30)
            status = mongod.status()
            if status != "stopped":
                LOGGER.error("Unable to stop the mongod service, in state '%s'", status)
                ret = 1

The function mongod.stop will try to kill an non-existent process and throw an exception. It should handle this situation where the process has already been killed, possibly in a try/except block.


Generated at Thu Feb 08 04:46:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.