Skip to content

fix: cap health check start interval by remaining start period#52317

Open
ogulcanaydogan wants to merge 1 commit intomoby:masterfrom
ogulcanaydogan:fix/46747-health-start-period-interval
Open

fix: cap health check start interval by remaining start period#52317
ogulcanaydogan wants to merge 1 commit intomoby:masterfrom
ogulcanaydogan:fix/46747-health-start-period-interval

Conversation

@ogulcanaydogan
Copy link
Copy Markdown
Contributor

Description

When HealthStartPeriod < HealthStartInterval, the health monitor waits for the full start interval before the next probe, even after the start period has ended. This delays the transition to the regular probe cadence.

For example with StartPeriod=2s and StartInterval=30s, the container's health status would not transition to unhealthy until ~30s instead of ~2s.

Fix

Cap the interval returned during the start period to the remaining time, so the monitor wakes up when the start period ends rather than sleeping past it.

Testing

Build compiles successfully. The fix is a minimal change to the interval calculation in the existing getInterval closure.

Fixes #46747

@github-actions github-actions Bot added the area/daemon Core Engine label Apr 6, 2026
@ogulcanaydogan
Copy link
Copy Markdown
Contributor Author

The CI failures (OracleLinux 8, snapshotter, and all Windows test jobs) appear to be infrastructure-related rather than caused by this change — the fix only modifies health check interval logic in daemon/health.go. Other PRs opened around the same time show 0 failures. Could a maintainer please trigger a CI re-run? Thanks!

@robmry
Copy link
Copy Markdown
Contributor

robmry commented Apr 10, 2026

Restarting the failed tests didn't work ... I'll close and reopen to get a new run.

@robmry robmry closed this Apr 10, 2026
@robmry robmry reopened this Apr 10, 2026
When HealthStartPeriod < HealthStartInterval, the monitor would wait
for the full start interval before the next probe even after the
start period ended. Cap the returned interval to the remaining start
period so the transition to the regular probe cadence is not delayed.

For example with StartPeriod=2s and StartInterval=30s, the monitor
now probes at 2s instead of waiting until 30s.

Fixes moby#46747

Signed-off-by: Ogulcan Aydogan <[email protected]>
@ogulcanaydogan ogulcanaydogan force-pushed the fix/46747-health-start-period-interval branch from f78e92f to db01679 Compare April 16, 2026 08:23
@ogulcanaydogan
Copy link
Copy Markdown
Contributor Author

CI is green now — thanks for the close/reopen to retrigger it @robmry! Happy to address any further feedback.

@ogulcanaydogan
Copy link
Copy Markdown
Contributor Author

CI is green. Ready when you have a moment, @robmry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/daemon Core Engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Behaviour when container HealthStartPeriod < HealthStartInterval is unintuitive

2 participants