Skip to content

Commit e335c57

Browse files
committed
linux: process: Remove zombie check (fixed in psutil)
1 parent dfeda1f commit e335c57

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

granulate_utils/linux/process.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,12 @@
3535

3636
def process_exe(process: psutil.Process) -> str:
3737
"""
38-
psutil.Process(pid).exe() returns "" for zombie processes, incorrectly. It should raise ZombieProcess, and return ""
39-
only for kernel threads.
40-
41-
See https://github.com/giampaolo/psutil/pull/2062
38+
psutil.Process(pid).exe() caches the result. This function returns the up-to-date exe in case the process exec-ed.
4239
"""
43-
# Clear the "exe" cache on the process object. It can change after being cached if the process execed.
40+
# Clear the "exe" cache on the process object
4441
process._exe = None # type: ignore
4542
exe = process.exe()
4643
if exe == "":
47-
if is_process_zombie(process):
48-
raise psutil.ZombieProcess(process.pid)
4944
raise MissingExePath(process)
5045
return exe
5146

0 commit comments

Comments
 (0)