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

Make RunOrDie start leader election loop in the background or document that it blocks #837

Closed
ChrsMark opened this issue Jul 30, 2020 · 1 comment

Comments

@ChrsMark
Copy link
Contributor

ChrsMark commented Jul 30, 2020

Hi, I was wondering if there is any particular reason of RunOrDie being a blocking function. I see that it blocks at

since LeaderElector will block in the leader election loop.

I found that k8s autoscaler leverage this blocking thing at https://github.com/kubernetes/autoscaler/blob/a63c7abbe47773be4eec49b13210a3cd9c4a719f/cluster-autoscaler/main.go#L421 and maybe changing this functionality may be a bad idea however how about introducing a sibling of RunOrDie called RunOrDieAsync which will be non-blocking? Otherwise I think the blocking fact should be documented to avoid confusion in the future by people using this library. Happy to provide a PR in any case.

@liggitt
Copy link
Member

liggitt commented Jul 30, 2020

Documenting the behavior is a good idea, PR is welcome. A separate method isn't needed since callers can do go RunOrDie if they want async behavior. The PR would need to be made to the https://github.com/kubernetes/kubernetes/ repo which is the canonical location for this code.

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

No branches or pull requests

2 participants