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

Powercycle should check for existence of a process before accessing it's attributes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 4.1.2
    • Testing Infrastructure
    • None
    • Fully Compatible
    • ALL
    • v4.0, v3.6
    • TIG 2018-08-27
    • 46
    • 1

    Description

      It's possible then when iterating over a list of processes that the process could finish before it's accessed:

              for proc in psutil.process_iter():
                  if proc.name() == self.name:
                      self.pids.append(proc.pid)
      

      An additional check should be added

      if psutil.pid_exists(proc.pid) and proc.name() == self.name
      

      Attachments

        Issue Links

          Activity

            People

              jonathan.abrahams Jonathan Abrahams
              jonathan.abrahams Jonathan Abrahams
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: