Ensure container zombie processes are reaped#5758
Ensure container zombie processes are reaped#5758nscuro merged 1 commit intoDependencyTrack:masterfrom
Conversation
Adds tini as init process to ensure that zombie processes (as possibly caused by health checks) to not pile up over time. Also extends the health check's timeout by a few seconds such that the curl command (with a lower timeout) is guaranteed to complete. Signed-off-by: nscuro <nscuro@protonmail.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
Pull request overview
This PR updates the Docker images so container zombie processes are properly reaped and the health check timeout is aligned with the curl invocation timing.
Changes:
- Add
tinias the init process in both the Debian- and Alpine-based Docker images and wire it up viaENTRYPOINT. - Adjust the Docker healthcheck timeout from 3 to 5 seconds while keeping curl’s internal
--max-time 3to ensure the check can complete reliably.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/main/docker/Dockerfile | Installs tini, configures it as the container ENTRYPOINT, and increases the healthcheck timeout to better accommodate curl’s max-time. |
| src/main/docker/Dockerfile.alpine | Installs tini on Alpine, configures it as the ENTRYPOINT, and increases the healthcheck timeout consistently with the Debian-based image. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesFootnotes
|
|
As far as I know, tini has been bundled with docker for a long time and you should use docker run --init to use it. |
|
@kutzi Thanks, I saw that. But unfortunately we cannot rely on all users setting that flag. I decided to err on the side of caution and just bake it into the image itself. |
Description
Ensures container zombie processes are reaped.
Adds tini as init process to ensure that zombie processes (as possibly caused by health checks) to not pile up over time.
Also extends the health check's timeout by a few seconds such that the curl command (with a lower timeout) is guaranteed to complete.
Addressed Issue
Fixes #3243
Additional Details
N/A
Checklist
This PR implements an enhancement, and I have provided tests to verify that it works as intendedThis PR introduces changes to the database model, and I have added corresponding update logicThis PR introduces new or alters existing behavior, and I have updated the documentation accordingly