Repository navigation
fix: honor MaxConsecutiveFailures for validateHealth failures - #2006
Merged
Merged
Conversation
MaxConsecutiveFailures bounds retries for deploy failures, but a failing validateHealth check was exempted from it entirely. handleDeployerError special-cased *clusterops.HealthCheckError to always return as retriable, skipping the maxNumberOfConsecutiveFailureReached check that every other error type goes through. The result: FeatureSummary.Status reported Failed with ConsecutiveFailures climbing in status, MaxConsecutiveFailures configured right next to it, and no enforcement ever happening: a health check that never passes retried forever regardless of the configured limit. handleDeployerError's HealthCheckError branch now checks maxNumberOfConsecutiveFailureReached before deciding whether to keep retrying, exactly like the generic error path already does. Once the limit is reached, the feature transitions to FailedNonRetriable the same way any other exhausted-retry error does. The transition logic (status update + event) is factored into a shared markMaxConsecutiveFailuresReached helper used by both the health-check branch and the existing generic fallthrough, so there is a single place that decides "budget exhausted" instead of two that could disagree. proceedDeployingClusterSummary needs no change: once the budget is spent, handleDeployerError no longer returns a *HealthCheckError, so its retry-pacing carve-out simply stops applying on its own. Below the limit, the health-check branch no longer re-applies FeatureStatusFailed itself: proceedDeployingFeature already records the failure with this same error before calling handleDeployerError, so doing it again there was double-counting every consecutive failure and tripping the limit at roughly half the configured value.
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.
MaxConsecutiveFailures bounds retries for deploy failures, but a failing validateHealth check was exempted from it entirely. handleDeployerError special-cased *clusterops.HealthCheckError to always return as retriable, skipping the maxNumberOfConsecutiveFailureReached check that every other error type goes through. The result: FeatureSummary.Status reported Failed with ConsecutiveFailures climbing in status, MaxConsecutiveFailures configured right next to it, and no enforcement ever happening: a health check that never passes retried forever regardless of the configured limit.
handleDeployerError's HealthCheckError branch now checks maxNumberOfConsecutiveFailureReached before deciding whether to keep retrying, exactly like the generic error path already does. Once the limit is reached, the feature transitions to FailedNonRetriable the same way any other exhausted-retry error does. The transition logic (status update + event) is factored into a shared markMaxConsecutiveFailuresReached helper used by both the health-check branch and the existing generic fallthrough, so there is a single place that decides "budget exhausted" instead of two that could disagree.
proceedDeployingClusterSummary needs no change: once the budget is spent, handleDeployerError no longer returns a *HealthCheckError, so its retry-pacing carve-out simply stops applying on its own.
Below the limit, the health-check branch no longer re-applies FeatureStatusFailed itself: proceedDeployingFeature already records the failure with this same error before calling handleDeployerError, so doing it again there was double-counting every consecutive failure and tripping the limit at roughly half the configured value.