You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tower SIGTERMs a reused shellper pid in the reconcile pre-filter (workspace missing / temp dir) #1879
Follow-up to #1877 (PR #1878, which deletes a reused-pid shellper row without signaling it). The same hazard remains on paths that PR did not touch.
In _reconcileTerminalSessionsInner() (packages/codev/src/agent-farm/servers/tower-terminals.ts), the Phase 1 pre-filter handles a shellper row whose workspace path no longer exists, or lives in a temp dir, like this:
There is no start-time check. After a reboot, shellper_pid can belong to an unrelated process (in #1877 it was /usr/libexec/diagnosticextensionsd). If that row's workspace is also gone, Tower SIGTERMs that unrelated process. That is worse than #1877, which only spammed the log.
Fix (suggested)
Gate both pre-filter kills on !(await isShellperPidReused(shellper_pid, shellper_start_time)). The helper is added in PR #1878 (terminal/session-manager.ts). The row is still deleted either way.
shellper-husk-sweep.ts declares its own PID_REUSE_TOLERANCE_MS = 2000, and its comment points at a stale line. It could import the constant from session-manager.ts.
shellper_start_time comes from the shellper's own Date.now(), while the guard reads ps -o lstart on macOS (one-second resolution) or the /proc/<pid> ctime on Linux. Only the 2s tolerance reconciles the two. Recording getProcessStartTime(pid) at spawn would put both sides on one clock.
Activity