Skip to content

Fail fast on Forbidden/Unauthorized during leader engine init#2

Merged
onrylmz merged 1 commit into
masterfrom
onur/failfast-init
May 8, 2026
Merged

Fail fast on Forbidden/Unauthorized during leader engine init#2
onrylmz merged 1 commit into
masterfrom
onur/failfast-init

Conversation

@onrylmz
Copy link
Copy Markdown
Contributor

@onrylmz onrylmz commented May 8, 2026

When the ServiceAccount lacks get on leases.coordination.k8s.io, New(...) blocks for 5 minutes (the full maxRetryDelay) before returning the Forbidden error — startup can't proceed in the meantime. Wrap Forbidden/Unauthorized in backoff.Permanent so the retry loop short-circuits. Other errors retry as before; NotFound is still treated as success.

Comment thread leader_election.go
Copy link
Copy Markdown
Member

@orhanasan orhanasan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, seems OK to me!

@onrylmz onrylmz merged commit a46d6ed into master May 8, 2026
1 check passed
@orhanasan orhanasan deleted the onur/failfast-init branch May 8, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants