Powercycle kill_mongod should not fail when calling mongod.stop

XMLWordPrintableJSON

    • Server Tooling & Methods
    • ALL
    • 26
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

              Assignee:
              Backlog - Server Tooling and Methods (STM) (Inactive)
              Reporter:
              Jonathan Abrahams (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: