mirror of
https://github.com/leonvanzyl/autocoder.git
synced 2026-01-30 06:12:06 +00:00
fix: kill process tree on agent completion to prevent zombies
Added _kill_process_tree call in _read_output finally block to ensure child processes (Claude CLI) are cleaned up when agents complete or fail. This prevents accumulation of zombie processes that was causing 78+ Python processes when max concurrency was set to 5. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -632,6 +632,12 @@ class ParallelOrchestrator:
|
||||
print(f"[Feature #{feature_id}] {line}", flush=True)
|
||||
proc.wait()
|
||||
finally:
|
||||
# CRITICAL: Kill the process tree to clean up any child processes (e.g., Claude CLI)
|
||||
# This prevents zombie processes from accumulating
|
||||
try:
|
||||
_kill_process_tree(proc, timeout=2.0)
|
||||
except Exception as e:
|
||||
debug_log.log("CLEANUP", f"Error killing process tree for {agent_type} agent", error=str(e))
|
||||
self._on_agent_complete(feature_id, proc.returncode, agent_type, proc)
|
||||
|
||||
def _on_agent_complete(
|
||||
|
||||
Reference in New Issue
Block a user