From bff7cbfdf0bc251fef08f7ac45210c74c437be40 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Wed, 3 Jan 2024 12:25:50 -0700 Subject: [PATCH] find_dispatcher_processes: Ignore zombies safely Signed-off-by: Zack Cerza --- teuthology/dispatcher/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/teuthology/dispatcher/__init__.py b/teuthology/dispatcher/__init__.py index 02ed2ee709..8a0ee1af1c 100644 --- a/teuthology/dispatcher/__init__.py +++ b/teuthology/dispatcher/__init__.py @@ -208,7 +208,10 @@ def main(args): def find_dispatcher_processes() -> Dict[str, List[psutil.Process]]: def match(proc): - cmdline = proc.cmdline() + try: + cmdline = proc.cmdline() + except psutil.ZombieProcess: + return False if len(cmdline) < 3: return False if not cmdline[1].endswith("/teuthology-dispatcher"): -- 2.39.5