Update process.py

This commit is contained in:
royjr
2026-08-22 00:57:18 -04:00
parent bdbaf6f074
commit fc98efe211
+8
View File
@@ -105,6 +105,12 @@ class ManagerProcess(ABC):
return ret
def reap(self) -> None:
# a process that exited on its own is otherwise never restarted: start() early-returns while proc is
# set, and only stop() clears it. modeld dying on a bad eGPU load left it dead for the whole drive.
if self.proc is not None and self.proc.exitcode is not None:
self.stop()
def signal(self, sig: int) -> None:
if self.proc is None:
return
@@ -145,6 +151,7 @@ class NativeProcess(ManagerProcess):
# In case we only tried a non blocking stop we need to stop it before restarting
if self.shutting_down:
self.stop()
self.reap()
if self.proc is not None:
return
@@ -169,6 +176,7 @@ class PythonProcess(ManagerProcess):
# In case we only tried a non blocking stop we need to stop it before restarting
if self.shutting_down:
self.stop()
self.reap()
if self.proc is not None:
return