openclaw - 💡(How to fix) Fix Orphaned node server.js worker processes accumulate after subagent/cron embedded runs

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

When the gateway spawns embedded agent runs (subagent spawns, cron agentTurn payloads), each run forks a node server.js worker process. When the run completes or times out, the worker process is not always terminated. These orphaned workers accumulate with PPID=1 (reparented to tini), each consuming 50-80MB RSS.

Over time, this causes monotonic RSS growth independent of the session write lock bug (#86014). With 75+ cron jobs running agentTurn payloads every few minutes, orphaned workers accumulate at ~40-160MB/minute.

Root Cause

When the gateway spawns embedded agent runs (subagent spawns, cron agentTurn payloads), each run forks a node server.js worker process. When the run completes or times out, the worker process is not always terminated. These orphaned workers accumulate with PPID=1 (reparented to tini), each consuming 50-80MB RSS.

Over time, this causes monotonic RSS growth independent of the session write lock bug (#86014). With 75+ cron jobs running agentTurn payloads every few minutes, orphaned workers accumulate at ~40-160MB/minute.

Fix Action

Workaround

  • init: true in docker-compose (tini as PID 1) prevents zombies but not orphans
  • Scheduled container restarts every 2 hours
  • RSS watchdog that restarts at 5GB before 6GB OOM limit
  • Moved cron to dedicated openclaw-cron container to isolate leak

Code Example

USER  PID   %CPU %MEM  RSS      COMMAND
root  7     88.7 0.8   1159992  openclaw          (gateway)
root  236   0.5  0.0   92472    node server.js    (orphaned worker)
root  537   0.3  0.0   81920    node server.js    (orphaned worker)
root  538   0.2  0.0   78336    node server.js    (orphaned worker)
root  539   0.1  0.0   65536    node server.js    (orphaned worker)
RAW_BUFFERClick to expand / collapse

Bug Report

Version: 2026.5.22 (also present in 2026.5.20) Platform: Docker (Debian-based), init: true (tini PID 1), Node.js v24.14.0

Summary

When the gateway spawns embedded agent runs (subagent spawns, cron agentTurn payloads), each run forks a node server.js worker process. When the run completes or times out, the worker process is not always terminated. These orphaned workers accumulate with PPID=1 (reparented to tini), each consuming 50-80MB RSS.

Over time, this causes monotonic RSS growth independent of the session write lock bug (#86014). With 75+ cron jobs running agentTurn payloads every few minutes, orphaned workers accumulate at ~40-160MB/minute.

Reproduction Steps

  1. Configure multiple cron jobs with agentTurn payloads
  2. Let them run for 30-60 minutes
  3. Run ps aux inside the container
  4. Observe multiple node server.js processes with PPID=1, not associated with any active session

Observed Behaviour

USER  PID   %CPU %MEM  RSS      COMMAND
root  7     88.7 0.8   1159992  openclaw          (gateway)
root  236   0.5  0.0   92472    node server.js    (orphaned worker)
root  537   0.3  0.0   81920    node server.js    (orphaned worker)
root  538   0.2  0.0   78336    node server.js    (orphaned worker)
root  539   0.1  0.0   65536    node server.js    (orphaned worker)

All workers have PPID=1 (tini). They persist until container restart.

Expected Behaviour

Worker processes should be terminated when their associated embedded run completes, times out, or errors.

Impact

  • ~280MB leaked per batch of 4 orphaned workers
  • With active cron, RSS grows at 40-160MB/min from orphans alone
  • Combined with #86014 (lock leak), RSS hits OOM limit within 30-45 minutes
  • Only mitigation is periodic container restart

Workaround

  • init: true in docker-compose (tini as PID 1) prevents zombies but not orphans
  • Scheduled container restarts every 2 hours
  • RSS watchdog that restarts at 5GB before 6GB OOM limit
  • Moved cron to dedicated openclaw-cron container to isolate leak

Related

  • #86014 — SessionWriteLockTimeoutError (distinct bug: file locks vs process lifecycle)

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Orphaned node server.js worker processes accumulate after subagent/cron embedded runs