R-772: a health probe that could not run records not_checked + NOT healthy, is looked at again on the 10 s cycle, and the app page says so
The state stays the containers' (probeSaysUnhealthy skips a not-checked record), so R-630 holds. Red-proof RP-D1 — felhom.eu audits/visitors-2026-10-01/D. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
@@ -114,10 +114,21 @@ type ContainerInfo struct {
|
||||
}
|
||||
|
||||
// HealthProbeResult holds the latest controller-side health probe result.
|
||||
// probeSaysUnhealthy: a probe that RAN and failed overrides a running state to unhealthy; a not-checked record (R-772)
|
||||
// does not — the containers decide. Pinned by TestProbeSaysUnhealthy_NotCheckedLeavesTheStateAlone.
|
||||
func probeSaysUnhealthy(hp *HealthProbeResult) bool {
|
||||
return hp != nil && !hp.Healthy && !hp.NotChecked
|
||||
}
|
||||
|
||||
type HealthProbeResult struct {
|
||||
Healthy bool `json:"healthy"`
|
||||
LastCheck time.Time `json:"last_check"`
|
||||
Details []HealthCheckDetail `json:"details"`
|
||||
// NotChecked: the declared check could not run — no container to probe (R-772). Healthy is then FALSE: a record of a
|
||||
// check that did not happen never says healthy (presence is not success). The stack's STATE is still read from its
|
||||
// containers (manager.go's override skips a not-checked record), so a running app is never painted unhealthy
|
||||
// because the box could not look. Pinned by TestRunHealthProbes_NoContainerIsNotHealthy.
|
||||
NotChecked bool `json:"not_checked,omitempty"`
|
||||
}
|
||||
|
||||
// HealthCheckDetail holds the result of a single health check item.
|
||||
@@ -812,7 +823,7 @@ func (m *Manager) refreshStatusLocked() error {
|
||||
|
||||
// Re-apply controller-side health probe results: if the last probe
|
||||
// failed and Docker thinks the container is running, override to unhealthy.
|
||||
if stack.State == StateRunning && stack.HealthProbe != nil && !stack.HealthProbe.Healthy {
|
||||
if stack.State == StateRunning && probeSaysUnhealthy(stack.HealthProbe) {
|
||||
stack.State = StateUnhealthy
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user