1
0
Fork 0
Code Issues Pull requests Projects Releases 2 Packages Wiki Activity Actions Pages

Allow explicit viewer lifecycle owner

This commit is contained in:
Andraxion 2026-07-24 22:09:02 -04:00
parent f6b9816ffd
commit 90898cfd63

View file

@ -669,11 +669,15 @@ class DetachedVisualizationRunner:
self,
index: ProjectIndex,
*,
owner_pid: int | None = None,
initial_grace_seconds: float = DEFAULT_INITIAL_GRACE_SECONDS,
lease_seconds: float = DEFAULT_LEASE_SECONDS,
monitor_interval_seconds: float = LEASE_MONITOR_INTERVAL_SECONDS,
) -> None:
if owner_pid is not None and owner_pid <= 1:
raise ValueError("Visualization owner PID must identify a live user process")
self.index = index
self.owner_pid = owner_pid if owner_pid is not None else os.getppid()
self.initial_grace_seconds = initial_grace_seconds
self.lease_seconds = lease_seconds
self.monitor_interval_seconds = monitor_interval_seconds
@ -729,7 +733,7 @@ class DetachedVisualizationRunner:
"initial_grace_seconds": self.initial_grace_seconds,
"lease_seconds": self.lease_seconds,
"monitor_interval_seconds": self.monitor_interval_seconds,
"owner_pid": os.getppid(),
"owner_pid": self.owner_pid,
"target": {
"node_id": node_id,
"query": query,