Repository navigation
fix(action): persist failure after a returned rollback error - #32871
Open
perfloop-agent wants to merge 2 commits into
Open
perfloop-agent wants to merge 2 commits into
perfloop-agent wants to merge 2 commits into
Conversation
Signed-off-by: Perfloop Agent <[email protected]> Signed-off-by: Tomás Senart <[email protected]>
Signed-off-by: Perfloop Agent <[email protected]> Signed-off-by: Tomás Senart <[email protected]>
|
Hi, I'm Tomás, I build Perfloop. I approved this contribution and will handle review feedback here. @gjenkins8, I tagged you because this change is in the We've had changes merged in Redis, Dolt, Prometheus, ClickHouse, Distribution, and more. If you'd like anything in this patch changed, just let me know and I'll update it. |
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.
What this PR does / why we need it:
When
performRollbackreturns an error and the new revision is stillpending-rollback,Rollback.Runmarks it failed, attempts to record it, and returns the same error. Already-finalized errors retain their existing handling. This persists a failure known to the running client; it does not retry, rerun hooks, bypass the pending check, or rescue revisions already stuck.Fixes #32867.
Special notes for your reviewer:
A returned hook timeout or watch error does not prove the hook Job stopped. After failure persistence, a later explicit upgrade can start while that Job may still run. Upgrade already persists hook failures through
failRelease, introduced in #6011. The fake-client tests do not prove real-hook safety.Killed clients, partial writes, and concurrent clients (helm/community#354) are out of scope; this change does not attempt them. A failed storage update can still leave the revision pending.
The additional best-effort Secret write runs on these still-pending failure paths, not successful rollbacks. In these measurements, manifest-build failures took about twice as long and pre-hook creation failures about half again as long. That time and allocation cost is accepted to persist the known failure rather than leave a completed operation holding the pending-state lock.
Medians below cover public rollback calls with two stored revisions and populated or template-free charts, using Secret serialization with a fake Kubernetes API, not cluster latency; each sample runs 100 rollback calls. The last column gives the median paired elapsed-time increase and its interval for the same measurements.
Precedent and validation
#3828, fixed by #3829 in 2018, described marking a failing rollback failed “as per the intention of the code.” In #7653, technosophos distinguished unsafe recovery of unknown pending states from “finding cases where pending-* is possibly mis-applied as a state, and fixing that.” This is the latter case: the client is still running and knows the rollback failed.
pkg/action/rollback_failure_test.gochecks persisted failure status and error propagation after manifest, hook, waiter, update, readiness, and deployed-query failures, then attempts an ordinary client-dry-run upgrade. It also checks previous-revision status semantics.Go tests for
pkg/action, excludingTestPullRun_ChartNotFound, and rollback CLI tests passed. The fullpkg/actionsuite, includingTestPullRun_ChartNotFound, passed in a separate run; that test also passed five runs on each revision. Action lint and source-header validation passed.If applicable:
docs neededlabel should be applied if so)Case and evidence
Made by Perfloop. Human sponsor: Tomás Senart.