Repository navigation
Description
Summary
In v2026.4.1 (and likely other recent versions), the browser control service spawns chromium child processes but does not reap them after normal exit. Over days, containers slowly accumulate thousands of <defunct> processes until they hit the PID limit, at which point spawn sh returns EAGAIN and all tool execution breaks.
This is distinct from #8611, which addresses the startup failure case (chromium exits immediately, parent hangs in a wait loop). Our issue is chromium that runs normally, exits cleanly, and is never reaped.
Environment
- OpenClaw: `alpine/openclaw:2026.4.1` (pulled from Docker Hub)
- Deployment: single gateway container per Linux VM (Ubuntu 24.04, 2GB droplet)
- Docker Compose, gateway runs as the container's PID 1
- Usage: agents use browser-based tools routinely (navigate, screenshot, etc.)
Evidence
Across 4 production instances running the same image:
| Uptime | Zombies | chromium | chrome_crashpad |
|---|---|---|---|
| 46h | 2,237 | 1,095 | 1,098 |
| 48h | 467 | 232 | 232 |
| 48h | 232 | 116 | 116 |
| 26h | 121 | 58 | 62 |
Every zombie's PPID is the single `openclaw` process inside the container. The chromium:chrome_crashpad ratio is consistently ~1:1, suggesting each browser invocation leaks both processes.
```
$ sudo ps -eo pid,ppid,stat,comm | awk '$3 ~ /Z/ {print $2}' | sort -u
$ sudo ps -p -o comm=
openclaw
```
Impact
At the extreme (2,237 zombies on a 2GB droplet) the container runs out of PIDs and every `child_process.spawn` call fails:
```
[process/supervisor] spawn failed: reason=Error: spawn sh EAGAIN
[tools] exec failed: spawn sh EAGAIN raw_params={"command":"python3 ..."}
```
The gateway itself stays alive but all tool execution is broken. `docker exec` into the container also fails (`procReady not received`), so operators can't even diagnose from inside.
Workaround
We added an external health check that counts defunct processes on the host and restarts the gateway container when the count exceeds 500. This is a band-aid — the underlying leak is still there.
Expected Fix
The parent of spawned chromium processes should `wait()` / listen for exit events and collect the exit status, so the kernel can reclaim the PID. Since the gateway runs as PID 1, a tini / `--init` wrapper doesn't help here — the parent is still alive, so orphaned-zombie reaping by init doesn't apply. This needs to be fixed in the browser control service itself.
Happy to collect more data (strace, specific tool that triggered the spawn, etc.) if useful.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Apr 27, 2026
Thanks for the context here. I did a careful shell check against current
main, and this is already implemented.Close as implemented: the supported Docker runtime now runs under Tini as PID 1, with Compose init coverage too, so the reported container topology that reparented Chromium/crashpad descendants to the OpenClaw gateway is fixed and shipped in v2026.5.18.
I found the merged PR that appears to have closed this: #78777: feat(docker): integrate tini as PID 1 init wrapper to reap zombie processes.
So I’m closing this as already implemented rather than keeping a duplicate issue open.
Review details
Best possible solution:
Keep the Tini-backed runtime image and Compose init coverage, and treat any v2026.5.18-or-newer browser zombie repro under Tini as a new focused browser lifecycle report.
Do we have a high-confidence way to reproduce the issue?
Yes for the original topology: the issue gives production PID-1 container diagnostics, and the pre-fix image lacked an init wrapper. Current main should not reproduce that same path because Tini is now PID 1 in the supported image.
Is this the best way to solve the issue?
Yes. Moving PID-1 reaping to Tini is the narrow runtime-boundary fix for adopted Chromium/crashpad descendants in supported containers; browser-service changes should wait for a current-image repro where Tini is already PID 1.
Security review:
Security review: No PR patch is under review, and this issue is a reliability report rather than a security-sensitive report.
What I checked:
Dockerfile:167, 78d226bb3b69)Dockerfile:311, 78d226bb3b69)docker-compose.yml:66, 78d226bb3b69)src/dockerfile.test.ts:60, 78d226bb3b69)Likely related people:
Dockerfile,docker-compose.yml,docs/install/docker.md)Dockerfile,docs/install/docker.md,docs/install/fly.md)Dockerfile,docs/install/docker.md,docs/install/fly.md)Codex review notes: model gpt-5.5, reasoning high; reviewed against 78d226bb3b69; fix evidence: merged PR #78777, release v2026.5.18, commit e63e4f9551e9.