You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Zombie processes accumulate in worker containers after child process exits #79909
After running HiClaw workers for a period of time, zombie processes accumulate in each worker container. Each worker container typically has 2 zombie processes:
[worker-entrypoi] - the worker entrypoint script
[hiclaw] - the hiclaw CLI process
Root Cause Analysis
The openclaw-gateway process inside worker containers spawns child processes (worker-entrypoint and hiclaw) but does not properly handle SIGCHLD signals to reap exited child processes.
Evidence
# Zombie process distribution (15 workers x 2 zombies each + 3 from manager)
$ ps aux | awk '$8=="Z"'| wc -l
32
# Each worker has 2 zombies:
$ docker exec hiclaw-worker-data-engineer ps aux | awk '$8=="Z"'
PID PPID STAT COMMAND
143 0 Z [worker-entrypoi]
199 0 Z [hiclaw]
# Parent processes are openclaw-gateway:
$ ps -eo pid,ppid,stat,comm | awk '$3 ~ /^Z/ {print $2}'| sort | uniq -c
2 163193 (openclaw-gateway)
2 164766 (openclaw-gateway)
...
Impact
Zombie processes do not consume CPU or memory
They occupy entries in the process table (currently 32/4,194,304)
Long-term accumulation could eventually exhaust the process table
No functional impact at current levels
Workaround
Restarting worker containers clears the zombie processes temporarily.
Environment
HiClaw Version: latest (hiclaw-worker:latest)
OS: Ubuntu 26.04 LTS (host)
Kernel: 7.0.0-15-generic
Suggested Fix
The openclaw-gateway process should:
Install a SIGCHLD signal handler
Call waitpid(-1, NULL, WNOHANG) in a loop to reap all exited children
Or use signal(SIGCHLD, SIG_IGN) to auto-reap children
Reproduction Steps
Start HiClaw with multiple workers
Wait for workers to execute tasks (which spawn child processes)
Observe zombie processes accumulating in worker containers
Thanks for writing this up. I checked the repo boundary, and this lives outside the OpenClaw source shell.
Close because the reported HiClaw worker image and process names are outside the OpenClaw source tree, while the repo-owned Docker runtime already has init-backed zombie reaping on current main.
So I’m closing this as outside the OpenClaw source repository rather than keeping it open as core work.
Review details
Best possible solution:
Keep OpenClaw's init-backed container runtime as-is; fix any HiClaw worker-specific reaping bug in that external worker image or refile with a current OpenClaw-owned reproduction.
Do we have a high-confidence way to reproduce the issue?
No. The report includes process-list evidence for hiclaw-worker:latest, but current OpenClaw main contains no HiClaw worker or worker-entrypoint surface and the maintained Docker runtime already enables init-backed reaping.
Is this the best way to solve the issue?
Not applicable as an OpenClaw source fix. The narrow maintainable path is external HiClaw worker-image repair, or a new current OpenClaw Docker reproduction that bypasses the existing tini/init setup.
Security review:
Security review: No patch was proposed, and this is not a security-sensitive issue report.
What I checked:
Issue targets external HiClaw worker image: The issue body names hiclaw-worker:latest and zombie commands [worker-entrypoi] and [hiclaw], not a current OpenClaw-owned image or source path.
No matching HiClaw worker surface in current source: A case-insensitive repository search found no current files matching hiclaw, hiclaw-worker, HiClaw, worker-entrypoint, or worker-entrypoi. (cb86388cec19)
OpenClaw runtime image uses tini: The current Dockerfile installs tini and sets ENTRYPOINT ["tini", "-s", "--"] before launching the OpenClaw gateway command. (Dockerfile:290, cb86388cec19)
Bundled Compose services enable Docker init: The maintained Compose file sets init: true for both openclaw-gateway and the openclaw-cli sidecar. (docker-compose.yml:62, cb86388cec19)
Docker docs document zombie reaping: The Docker install docs say the main runtime image includes tini as PID 1 to reap zombie processes and handle signals in long-running containers. Public docs: docs/install/docker.md. (docs/install/docker.md:430, cb86388cec19)
VintageAyu: Authored the merged Docker runtime change that runs the image under tini and updated the Docker docs covering zombie reaping. (role: recent Docker runtime init contributor; confidence: high; commits: e63e4f9551e9, f9da4843652e; files: Dockerfile, docker-compose.yml, docs/install/docker.md)
steipete: Recent history shows repeated Dockerfile, Docker docs, and runtime packaging work around the maintained container boundary relevant to this report. (role: recent Docker/runtime maintainer; confidence: medium; commits: 330ba1fa3194, ed8f50f240a8, a3bbcf2792b1; files: Dockerfile, docker-compose.yml, docs/install/docker.md)
sallyom: Recent Docker history includes Docker docs/runtime-image changes and reviewer context on container setup changes adjacent to the maintained Docker path. (role: adjacent Docker packaging reviewer/contributor; confidence: medium; commits: 484a289be34e, e8258fd4a6eb; files: Dockerfile, docs/install/docker.md)
Codex review notes: model gpt-5.5, reasoning high; reviewed against cb86388cec19.
Activity
clawsweeper commentedon May 9, 2026
Thanks for writing this up. I checked the repo boundary, and this lives outside the OpenClaw source shell.
Close because the reported HiClaw worker image and process names are outside the OpenClaw source tree, while the repo-owned Docker runtime already has init-backed zombie reaping on current main.
So I’m closing this as outside the OpenClaw source repository rather than keeping it open as core work.
Review details
Best possible solution:
Keep OpenClaw's init-backed container runtime as-is; fix any HiClaw worker-specific reaping bug in that external worker image or refile with a current OpenClaw-owned reproduction.
Do we have a high-confidence way to reproduce the issue?
No. The report includes process-list evidence for
hiclaw-worker:latest, but current OpenClaw main contains no HiClaw worker or worker-entrypoint surface and the maintained Docker runtime already enables init-backed reaping.Is this the best way to solve the issue?
Not applicable as an OpenClaw source fix. The narrow maintainable path is external HiClaw worker-image repair, or a new current OpenClaw Docker reproduction that bypasses the existing tini/init setup.
Security review:
Security review: No patch was proposed, and this is not a security-sensitive issue report.
What I checked:
hiclaw-worker:latestand zombie commands[worker-entrypoi]and[hiclaw], not a current OpenClaw-owned image or source path.hiclaw,hiclaw-worker,HiClaw,worker-entrypoint, orworker-entrypoi. (cb86388cec19)tiniand setsENTRYPOINT ["tini", "-s", "--"]before launching the OpenClaw gateway command. (Dockerfile:290, cb86388cec19)init: truefor bothopenclaw-gatewayand theopenclaw-clisidecar. (docker-compose.yml:62, cb86388cec19)tinias PID 1 to reap zombie processes and handle signals in long-running containers. Public docs:docs/install/docker.md. (docs/install/docker.md:430, cb86388cec19)Likely related people:
Dockerfile,docker-compose.yml,docs/install/docker.md)Dockerfile,docker-compose.yml,docs/install/docker.md)Dockerfile,docs/install/docker.md)Codex review notes: model gpt-5.5, reasoning high; reviewed against cb86388cec19.