catapult-project / catapult

Deprecated Catapult GitHub. Please instead use http://crbug.com "Speed>Benchmarks" component for bugs and https://chromium.googlesource.com/catapult for downloading and editing source code..
https://chromium.googlesource.com/catapult
BSD 3-Clause "New" or "Revised" License
1.91k stars 563 forks source link

Catch psutil.NoSuchProcess when iterating over processes in catapult #4546

Open taop1 opened 5 years ago

taop1 commented 5 years ago

When the running process is over the psutil.NoSuchProcess exception is raised but we don't handle that case.

`Traceback (most recent call last):

at d:\buildagent\temp\buildtmp\perf_root_lkioz5\src\tools\perf\run_benchmark:27 sys.exit(main()) main at d:\buildagent\temp\buildtmp\perf_root_lkioz5\src\tools\perf\run_benchmark:23 return benchmark_runner.main(config, [trybot_command.Trybot]) main at d:\buildagent\temp\buildtmp\perf_root_lkioz5\src\third_party\catapult\telemetry\telemetry\benchmark_runner.py:439 return command_instance.Run(options) Run at d:\buildagent\temp\buildtmp\perf_root_lkioz5\src\third_party\catapult\telemetry\telemetry\benchmark_runner.py:309 return min(255, b.Run(args)) Run at d:\buildagent\temp\buildtmp\perf_root_lkioz5\src\third_party\catapult\telemetry\telemetry\benchmark.py:99 return story_runner.RunBenchmark(self, finder_options) RunBenchmark at d:\buildagent\temp\buildtmp\perf_root_lkioz5\src\third_party\catapult\telemetry\telemetry\internal\story_runner.py:421 memory_debug.LogHostMemoryUsage() LogHostMemoryUsage at d:\buildagent\temp\buildtmp\perf_root_lkioz5\src\third_party\catapult\common\py_utils\py_utils\memory_debug.py:64 pinfo = _GetProcessInfo(p) _GetProcessInfo at d:\buildagent\temp\buildtmp\perf_root_lkioz5\src\third_party\catapult\common\py_utils\py_utils\memory_debug.py:34 pinfo = p.as_dict(attrs=['pid', 'name', 'memory_info']) as_dict at d:\buildagent\temp\buildtmp\tmpfvfvb2.venv\bin\lib\site-packages\psutil\__init__.py:527 ret = meth() name at d:\buildagent\temp\buildtmp\tmpfvfvb2.venv\bin\lib\site-packages\psutil\__init__.py:605 name = self._proc.name() wrapper at d:\buildagent\temp\buildtmp\tmpfvfvb2.venv\bin\lib\site-packages\psutil\_pswindows.py:635 return fun(self, *args, **kwargs) name at d:\buildagent\temp\buildtmp\tmpfvfvb2.venv\bin\lib\site-packages\psutil\_pswindows.py:687 return py2_strencode(os.path.basename(self.exe())) wrapper at d:\buildagent\temp\buildtmp\tmpfvfvb2.venv\bin\lib\site-packages\psutil\_pswindows.py:640 raise NoSuchProcess(self.pid, self._name) NoSuchProcess: psutil.NoSuchProcess process no longer exists (pid=1860)`