Repository navigation
fix(docker): run images under tini so orphaned prisma node processes are reaped - #49448
Closed
ianalloway wants to merge 1 commit into
Closed
ianalloway wants to merge 1 commit into
ianalloway wants to merge 1 commit into
Conversation
…are reaped The prisma CLI forks a detached node child that is reparented to PID 1 (the litellm python process) and never reaped, leaving permanent <defunct> zombies (BerriAI#33414, BerriAI#14739, BerriAI#10216). Install Wolfi's tini in the runtime stage and wrap the entrypoint with it in all three Dockerfiles. Supersedes BerriAI#33599, which targeted the stale litellm_oss_daily_2026_07_20 branch. Signed-off-by: Ian Alloway <200005377+ianalloway@users.noreply.github.com>
5 tasks done
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relevant issues
Fixes #33414
Supersedes #33599, which targeted the stale
litellm_oss_daily_2026_07_20branch (no updates since Aug 3, and it no longer merges cleanly with main). This is the same 4-file change re-applied on top of currentmain.Pre-Submission checklist
tiniis in the public Wolfi index (tini-0.19.0-r26) and installs/usr/bin/tini; the root Dockerfile's ENTRYPOINT/CMD still pass thetest_container_build_no_network_fetchcheckScreenshots / Proof of Fix
Repro from #33599: postgres 16 + the litellm image with
DATABASE_URLset. Before isghcr.io/berriai/litellm:main-latest; after is the same image with only the entrypoint change applied.The unpatched container accumulates one defunct node process per prisma CLI invocation at startup. The patched container has tini at PID 1, no zombies, and
/health/livelinessstill returns"I'm alive!".Type
🐛 Bug Fix
Changes
docker/prod_entrypoint.shends inexec litellm "$@", so litellm runs as PID 1. WhenDATABASE_URLis set the proxy shells out to the prisma CLI, a node program that forks a detached child. That child is reparented to PID 1, and since python is not an init nothing reaps it, leaving the permanent[node-MainThread] <defunct>zombie from #33414 (also #14739 and #10216).tinito the runtimeapk addline inDockerfile,docker/Dockerfile.database, anddocker/Dockerfile.non_root["/usr/bin/tini", "--", <existing entrypoint>]docker/tests/nonroot.yamlhad drifted from the non_root image entrypoint (docker/prod_entrypoint.shvs/app/docker/prod_entrypoint.sh); updated it to the new tini entrypointNo application code changes. The in-process engine reaping (#48895) is complementary: it covers the query engine litellm owns, and tini covers orphans that get reparented to PID 1.
QA runbook
DATABASE_URLset and a minimal configdocker exec <ct> ps -efand look for<defunct>