From da7aef69f315f56eb9ae792d415fb456a109a9eb Mon Sep 17 00:00:00 2001 From: Kyr Shatskyy Date: Thu, 1 Aug 2024 23:58:08 +0200 Subject: [PATCH 1/2] dispatcher: fix AccessDenied on process lookup On macOS dispatcher while trying to go through process list gets stuck on some of the system processes like launchd, logd, systemstats, etc. and quites unexpectedly with PermissionError and psutil.AccessDenied exceptions. Fixes: https://tracker.ceph.com/issues/67313 Signed-off-by: Kyr Shatskyy --- teuthology/dispatcher/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/teuthology/dispatcher/__init__.py b/teuthology/dispatcher/__init__.py index 7cbaf7449..e97d17513 100644 --- a/teuthology/dispatcher/__init__.py +++ b/teuthology/dispatcher/__init__.py @@ -205,6 +205,8 @@ def find_dispatcher_processes() -> Dict[str, List[psutil.Process]]: def match(proc): try: cmdline = proc.cmdline() + except psutil.AccessDenied: + return False except psutil.ZombieProcess: return False if len(cmdline) < 3: From d218c61fa24d76863a6b37c617cc2aea5ab206b8 Mon Sep 17 00:00:00 2001 From: Kyr Shatskyy Date: Fri, 2 Aug 2024 17:17:14 +0200 Subject: [PATCH 2/2] kill: handle AccessDenied exception Fix unhandled exception psutilAccessDenied in process_matches_run(). Signed-off-by: Kyr Shatskyy --- teuthology/kill.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/teuthology/kill.py b/teuthology/kill.py index 720096a26..a18e0ac8a 100755 --- a/teuthology/kill.py +++ b/teuthology/kill.py @@ -223,6 +223,8 @@ def process_matches_run(pid, run_name): return True except psutil.NoSuchProcess: pass + except psutil.AccessDenied: + pass return False