-
Notifications
You must be signed in to change notification settings - Fork 49
Closed
Description
Noticed that while the sdk reports processes as killed it seems like we had process running to completion. even after switching from term to kill signal. Poking around the sdk with the help of the 🤖 found that:
When calling killProcess() on a background process started via startProcess(), the API returns success: true but the actual process continues running.
The issue is in packages/sandbox-container/src/session.ts. When a background process is started, it runs inside a bash subshell:
{
# command runs here
} < /dev/null > "$sp" 2> "$ep" & CMD_PID=$!
echo "$CMD_PID" > ${pidFile}The $CMD_PID stored is the subshell PID, not the actual command PID. When killCommand() sends SIGTERM to this PID:
- The subshell receives SIGTERM
- Bash does NOT propagate signals to child processes by default
- The subshell terminates
- The actual command becomes an orphan process and keeps running
Metadata
Metadata
Assignees
Labels
No labels