#243 BUG: Workflow cancel doesn't kill shell child processes

open critical Created 2025-12-03 15:27 · Updated 2025-12-03 15:27

Description

Edit
When a workflow is cancelled, shell processes spawned by tools.shell.run are NOT terminated. Current cancel logic: 1. Cancels Absurd task queue entry 2. Updates workflow_run status 3. Cleans up Docker containers Missing: No mechanism to kill subprocess.Popen processes spawned by ShellOutputStreamer or shell tools. Result: Orphaned processes continue running after workflow cancel. Reproduction: 1. Start workflow with long-running shell command (e.g., http.server) 2. Cancel workflow via API 3. Check: process still running (ps aux | grep http.server) Fix needed: 1. Track PIDs in activity_queue or separate table 2. On activity cancel, send SIGTERM then SIGKILL to tracked PIDs 3. ShellOutputStreamer needs to store process.pid and expose kill method

Comments

Loading comments...

Context

Loading context...

Audit History

View All
Loading audit history...