Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-37493

Powercycle kill_mongod should not fail when calling mongod.stop

    XMLWordPrintable

    Details

    • Operating System:
      ALL
    • Linked BF Score:
      14

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: