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

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.1.2
    • Affects Version/s: None
    • Component/s: Testing Infrastructure
    • Labels:
      None
    • Fully Compatible
    • ALL
    • v4.0, v3.6
    • TIG 2018-08-27
    • 46
    • 1

      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
      

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

              Created:
              Updated:
              Resolved: