Repository navigation
fix: remove the resume timer before resuming a paused deployment - #1220
Merged
SyedaFatimaKazmi merged 2 commits intoOct 2, 2026
Merged
Conversation
ResumeDeployment removed the timer entry only after it had fetched the deployment. If that Get failed, the already-fired timer stayed in activeTimers, so PauseDeployment never called HandleMissingTimer again and the deployment stayed paused. Fixes stakater#1219 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EcwjgZmx8zbtn6PpwDY9A1
SyedaFatimaKazmi
previously approved these changes
Sep 16, 2026
SyedaFatimaKazmi
left a comment
Contributor
There was a problem hiding this comment.
Thank you for your contribution. This is the right fix, and I like that it stays minimal.
I have left two minor comments below. None of them block the merge but they are small additions and a naming point. Happy to merge once you have had a look at them.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011Yyp6p2GWzkWKLsrxxJR1U
msafwankarim
added a commit
that referenced
this pull request
Sep 17, 2026
Guards the v2 equivalent of the recovery PR #1220 restores on master. v2 keeps no timer map, so a failed resume is retried by controller-runtime rather than recreated from a missing timer.
msafwankarim
approved these changes
Sep 21, 2026
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.
Fixes #1219
ResumeDeploymentremoved the timer entry fromactiveTimersonly after theGetof the deployment succeeded. If thatGetfailed (for example the API server was briefly unavailable when the timer fired), the function returned early and left the already-fired timer in the map.PauseDeploymentonly callsHandleMissingTimerwhen there is no entry for the deployment, so the deployment stayed paused and was never retried.This moves the timer removal to the start of
ResumeDeployment. By the time it runs, the timer has either fired or doesn't exist (theHandleMissingTimerpath). A failed attempt then leaves no entry behind, and the next change to the deployment goes throughHandleMissingTimeragain. This also covers the other early returns (IsPausedByReloaderfalse, resume patch creation failing), which had the same problem.Testing
TestResumeDeploymentRetriesAfterFailedGetuses a fake clientset with a reactor that failsget deploymentsonce, and checks that:PauseDeploymentcall for the still-paused deployment (pause period expired) resumes it.The handler package needs a cluster for its test setup, so I ran the suite through the repository's pull request workflow on my fork: https://github.com/kaanisthatyou/Reloader/actions/runs/34899925407.
golangci-lint,make test(including--- PASS: TestResumeDeploymentRetriesAfterFailedGet), the E2E tests and the A/B load tests passed. Only "Build Docker UBI Image" failed, because the fork can't pull from its ownghcr.ionamespace. Locally,go vet ./internal/pkg/handler/passes.🤖 Generated with Claude Code
https://claude.ai/code/session_01EcwjgZmx8zbtn6PpwDY9A1