agent-orchestrator icon indicating copy to clipboard operation
agent-orchestrator copied to clipboard

ao-web next-server leaks zombie processes (~11/min) until the OS process-table cap; machine-wide fork failures

Open Tonedeath opened this issue 4 months ago • 3 comments

Summary

ao-web's next-server (both the supervised :3000 instance started by ao start and the dist-server/direct-* variant) does not reap the child processes it spawns. Zombies (<defunct>) accumulate at roughly 11/minute under normal dashboard operation until the per-user process-table cap is reached, at which point every process on the machine starts failing with fork failed: resource temporarily unavailable.

Environment

  • @aoagents/ao 0.9.5 / @aoagents/ao-web 0.9.5 (global install)
  • macOS (Darwin 25.5.0), node v22.21.0
  • kern.maxprocperuid = 2666

Observed incident (2026-07-28/29)

  • ao start <project> supervises ao-web (wrapper → next-server). Within ~1.5-3h of uptime, ps -axo stat | grep -c Z reached 1,145 zombies, all with the next-server PID as parent (verified via ps -axo ppid=,stat=).
  • Combined with live processes (~750), the user hit the 2,666 process cap: unrelated tools began failing to fork (observed across shells, git, gh, and plausibly contributed to Docker Desktop and an Electron app dying the same day).
  • kill <next-server-pid> reparented the zombies to launchd, which reaped them instantly (1,053 → 0), confirming the parent simply never wait()s.
  • The ao daemon respawns ao-web after a kill, so the leak restarts (~3h to crisis per cycle).

Ask

  1. Reap spawned children in ao-web's server (SIGCHLD handler / child.on('exit') on whatever spawns the per-request work — the zombie births correlate with dashboard polling activity).
  2. Optionally: a --no-web flag for ao start so headless operators can opt out of the dashboard entirely.

Happy to provide more diagnostics from a live leak if useful.

Tonedeath avatar Jul 30 '26 13:07 Tonedeath

Thanks for contributing to Agent Orchestrator.

This issue is being picked up by the current external contributor on-call pair:

  • @illegalcall
  • @pulkit7070

If someone is already working on this, please continue as usual. The on-call pair is added for visibility, tracking, and support, not to take over the work. If you need help with review, direction, reproduction, or next steps, please tag @illegalcall and @pulkit7070 here.

For faster context or live questions, you can also join the AO Discord.

Join the session here: https://discord.gg/H6ZDcUXmq

Come by if you want to see what is being built, ask questions, or just hang around with the community.

somewherelostt avatar Jul 30 '26 15:07 somewherelostt

@AgentWrapper The reported ao-web and next-server process path does not exist in current main. Current preview and runtime processes use the Go and Electron supervision paths. This legacy issue can be closed as obsolete.

Rishet11 avatar Aug 28 '26 21:08 Rishet11

Hi @Tonedeath, the ao-web next-server is gone from main entirely (the rewrite removed that architecture), so the zombie-process leak has no code left to fix. Closing as obsolete. Thanks for the investigation.

Rishet11 avatar Sep 03 '26 15:09 Rishet11