Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⚠️ Use leader elector with client timeout #3028

Merged
merged 1 commit into from
Nov 30, 2024

Conversation

alvaroaleman
Copy link
Member

This change makes the leader elector use a client that internally has a smaller timeout than the renew deadline, which avoids a situation where a single request timing out makes us lose the leader lease.

Fixes #3027

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 30, 2024
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 30, 2024
@alvaroaleman alvaroaleman changed the title :breaking: Use leader elector with client timeout :warn: Use leader elector with client timeout Nov 30, 2024
This change makes the leader elector use a client that internally has
a smaller timeout than the renew deadline, which avoids a situation
where a single request timing out makes us lose the leader lease.
@alvaroaleman alvaroaleman changed the title :warn: Use leader elector with client timeout ⚠️ Use leader elector with client timeout Nov 30, 2024
Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

Should we backport this? Seems like an important fix

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 30, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alvaroaleman, vincepri

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [alvaroaleman,vincepri]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: a7ebc71ff2612a7fe445a126bd5613ec6bb7740e

@k8s-ci-robot k8s-ci-robot merged commit 00173cf into kubernetes-sigs:main Nov 30, 2024
12 of 13 checks passed
@serathius
Copy link

serathius commented Nov 30, 2024

I would recommend backport, GKE backported if for critical controllers.

@vincepri
Copy link
Member

/cherry-pick release-0.18
/cherry-pick release-0.19

@k8s-infra-cherrypick-robot

@vincepri: new pull request created: #3030

In response to this:

/cherry-pick release-0.18
/cherry-pick release-0.19

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-infra-cherrypick-robot

@vincepri: new pull request created: #3031

In response to this:

/cherry-pick release-0.18
/cherry-pick release-0.19

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Comment on lines +52 to +53
// RewnewDeadline is the renew deadline for this leader election client
RewnewDeadline time.Duration
Copy link
Member

Choose a reason for hiding this comment

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

This should be RenewDeadline, right? Typo @alvaroaleman

Copy link
Member

Choose a reason for hiding this comment

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

@alvaroaleman
Copy link
Member Author

@vincepri I don't think we can backport this, the leader election options where I added the paramter are exported, this change breaks anyone who uses that directly.

Given that no one noticed this for years, I think its okay to not backport and wait for the next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix leader election request timeout
5 participants