fix(applications): exclude health-check-excluded containers from restart limit - #11032
Open
nikrabaev wants to merge 2 commits into
Open
fix(applications): exclude health-check-excluded containers from restart limit#11032nikrabaev wants to merge 2 commits into
nikrabaev wants to merge 2 commits into
Conversation
nikrabaev
force-pushed
the
fix/exclude-containers-from-restart-limit
branch
2 times, most recently
from
July 24, 2026 13:23
71be0a7 to
d67d057
Compare
…art limit The crash restart limit counted Docker RestartCount across all app containers, including ones excluded from health checks (exclude_from_hc or restart: no). Scheduled or one-shot sidecars like Ofelia jobs thus tripped the limit and stopped the whole app. Exclude them from the count too, matching status aggregation. Fixes coollabsio#10624 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a DB-backed test driving GetContainersStatus::handle() with synthetic docker-inspect payloads: an excluded (restart:no / exclude_from_hc) container with a high RestartCount does not trip the limit, while a monitored container does and dispatches StopApplication. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
nikrabaev
force-pushed
the
fix/exclude-containers-from-restart-limit
branch
from
July 24, 2026 13:28
d67d057 to
446508e
Compare
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.
Changes
The crash restart-limit feature (default 10) counted Docker's lifetime
RestartCountacross every container of an application — including containers that are excluded from health checks viaexclude_from_hcorrestart: no. Status aggregation already skips those containers, so the two code paths disagreed.Because of this, a scheduled or one-shot sidecar that legitimately starts and stops (an Ofelia scheduler, or any restart:no cron/job container) inflated the count, hit the limit, and Coolify stopped the whole application with a "10x restarts" warning.
This change excludes the same health-check-excluded containers from the restart-count calculation, so restart counting matches status aggregation:
No configuration, schema, UI, or default-behaviour changes.
Issues
Category
AI Assistance
If AI was used:
Testing
Added tests/Unit/RestartLimitExcludesExcludedContainersTest.php covering: excluded containers dropped from the max restart count, non-excluded crash loops still counted, legacy behaviour when nothing is excluded, and restart:no / exclude_from_hc resolved through the real trait helper. Ran the new suite plus the existing RestartCountTrackingTest — 10 passed. Pint clean on the changed files.
Contributor Agreement
Important