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

Provide platform-independent method to whack the running process

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Internal Code
    • Server Security

    Description

      When we run external daemons such as service mocks, we typically use stopMongoProgramByPid to terminate them. This invocation does not work the same way on all platforms, which leads to the need to use complex shutdown methodologies such as:

       
      function killPyKMIPServer(pid) {
          if (_isWindows()) {
              // we use taskkill because we need to kill children
              waitProgram(_startMongoProgram("taskkill", "/F", "/T", "/PID", pid));
              // waitProgram to ignore error code
              waitProgram(pid);
          } else {
              let kSIGINT = 2;
              stopMongoProgramByPid(pid, kSIGINT);
          }
      }
      

      This ticket is to research and implement a single function which would reliably terminate the process by PID on every platform, also killing children and gradually stepping up terminate signals on linux (SIGTERM, then SIGINT, then SIGKILL)

      Attachments

        Activity

          People

            backlog-server-security Backlog - Security Team
            sergey.galtsev@mongodb.com Sergey Galtsev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: