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

Leader election: do not wait 2 hours for retry, even in dev mode #232

Merged
merged 1 commit into from
Nov 28, 2022

Conversation

moio
Copy link
Contributor

@moio moio commented Oct 24, 2022

I found it useful to leverage the CATTLE_DEV_MODE environment variable in order to make leader leases last longer - this is pretty much needed when attaching a debugger (eg. via delve) - else the process is automatically killed after some seconds.

Problem with CATTLE_DEV_MODE in that scenario is, at the moment, that it also elongates the retry period, which means the initial leader election at process start will also take two hours, which is a bit impractical.

This PR tries to address the issue by elongating all times but the retry period - I tested it manually and it works great for delve debugging.

Related: #234
Issue: rancher/rancher#39506

Signed-off-by: Silvio Moioli <silvio@moioli.net>
@rmweir rmweir self-requested a review October 28, 2022 22:55
Copy link
Contributor

@rmweir rmweir left a comment

Choose a reason for hiding this comment

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

LGTM, cannot merge until q1 release and until at least 1 more review before merging.

@cbron cbron requested a review from cmurphy November 2, 2022 15:51
@mattfarina
Copy link
Contributor

@rmweir @cmurphy can we merge this now?

@cbron
Copy link
Contributor

cbron commented Nov 28, 2022

I'm going to merge and label issue as dev validate.
@moio we don't use "fixes" on github or it will close things out pre-QA. I edited description.

@cbron cbron merged commit 672366f into rancher:master Nov 28, 2022
@moio moio deleted the lease_retry_tweak branch November 29, 2022 09:27
moio added a commit to moio/fleet that referenced this pull request Nov 30, 2022
Main motivation is to get rancher/wrangler#232

Leader election: do not wait 2 hours for retry, even in dev mode

Signed-off-by: Silvio Moioli <silvio@moioli.net>
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.

5 participants