fix(step-ca): prevent PID exhaustion from zombie health check processes#120
Open
rdemeritt wants to merge 1 commit into
Open
fix(step-ca): prevent PID exhaustion from zombie health check processes#120rdemeritt wants to merge 1 commit into
rdemeritt wants to merge 1 commit into
Conversation
Add init: true so tini reaps zombie children spawned by Docker's health check mechanism. Switch healthcheck from CMD-SHELL to CMD (exec) form to eliminate the intermediate /bin/sh child, halving the fork rate. Without these fixes, step-ca accumulates ~14k zombie PIDs over ~25 hours until fork() returns EAGAIN and the container goes permanently unhealthy.
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.
Summary
CMD-SHELL, which forks/bin/sh → wget. Since step-ca Go binary is PID 1 and doesn't reap children, each health check cycle leaves zombie processes. Eventuallyfork()returnsEAGAINand the container goes permanently unhealthy.init: true): Docker injectstinias PID 1, which properly reaps all zombie children from health check forks — the permanent fix.CMD-SHELLtoCMDexec form, eliminating the intermediate/bin/shprocess and halving the fork rate per health check cycle.Option A (container restart) was already applied directly on macbeth to restore health immediately.
Test plan
./scripts/start.sh -d --buildcopper-rabbit-step-ca-1shows(healthy)indocker ps