Skip to content

Commit 14bc89d

Browse files
committed
linux: process: Remove zombie check (fixed in psutil)
1 parent 5cb9a2f commit 14bc89d

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
@@ -24,17 +24,12 @@
2424

2525
def process_exe(process: psutil.Process) -> str:
2626
"""
27-
psutil.Process(pid).exe() returns "" for zombie processes, incorrectly. It should raise ZombieProcess, and return ""
28-
only for kernel threads.
29-
30-
See https://github.com/giampaolo/psutil/pull/2062
27+
psutil.Process(pid).exe() caches the result. This function returns the up-to-date exe in case the process exec-ed.
3128
"""
32-
# Clear the "exe" cache on the process object. It can change after being cached if the process execed.
29+
# Clear the "exe" cache on the process object
3330
process._exe = None # type: ignore
3431
exe = process.exe()
3532
if exe == "":
36-
if is_process_zombie(process):
37-
raise psutil.ZombieProcess(process.pid)
3833
raise MissingExePath(process)
3934
return exe
4035

0 commit comments

Comments
 (0)