fix(runtime): unify process and task state handling

This commit is contained in:
somew1nd committed 2026-09-01 11:35:23 -07:00
1 parent cbe8f4f0c6
commit 9cee112cd2
14 files changed
+918 -197

No files matched your search

+5 -9
View File
@@ -45,16 +45,12 @@ def _pid_alive(pid: int | None) -> bool:
if not pid:
return False
try:
import psutil
pid_int = int(pid)
except (TypeError, ValueError):
return False
from artemis.runtime.process_probe import pid_is_alive
proc = psutil.Process(int(pid))
return proc.is_running() and proc.status() != psutil.STATUS_ZOMBIE
except Exception:
try:
os.kill(int(pid), 0)
return True
except OSError:
return False
return pid_is_alive(pid_int)
def _session_tracked_by_lock(trace_id: str) -> bool: