Repository navigation
Delay recreation of a listener pod that exited with a failure - #4703
Open
CloudNinjaDev wants to merge 1 commit into
Open
CloudNinjaDev wants to merge 1 commit into
CloudNinjaDev wants to merge 1 commit into
Conversation
The listener pod uses restartPolicy Never, so the controller is the only thing pacing restarts. A listener that fails deterministically on startup (revoked token, exhausted API rate limit) was deleted and recreated immediately, repeating the auth handshake against GitHub every few seconds and burning API quota. Keep a pod whose listener container exited non-zero for 15s after it finished before deleting it. Clean exits and pods without a finish time are still recreated immediately. Fixes actions#4656
CloudNinjaDev
requested review from
a team,
Steve-Glass,
mumoshu,
nikola-jokic,
rentziass and
toast-gear
as code owners
October 2, 2026 16:21
4 tasks done
This branch has not been deployed
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.
Summary
Fixes #4656.
The listener pod is built with
restartPolicy: Never, so the controller is the only thing pacing restarts. A listener that fails deterministically on startup (revoked token, exhausted API rate limit) was deleted and recreated immediately, repeating the auth handshake against GitHub every few seconds and burning API quota.This keeps a dead listener pod whose container exited with a non-zero code for 15s after it finished before deleting it, by returning
RequeueAfterwith the remaining time. The terminated pod stays visible meanwhile. Clean exits (code 0), evictions, and pods with no finish time are recreated immediately as before.This is the minimal, CRD-free variant suggested in the issue: a fixed delay without escalation or status changes. A growing backoff could be layered on later if maintainers want it.
Testing
Local run (go1.27.1, envtest k8s 1.37.0):
The existing envtest listener suite (including the test that a terminated listener container gets its pod re-created) still passes. Those tests use pods without a finish time, so they are not delayed.