leaderelection do not stop leading properly
What happened (please include outputs or screenshots):
After onstarted_leading function throw exception and finish, the process still leading.
What you expected to happen: The process stop leading immediatly.
How to reproduce it (as minimally and precisely as possible):
Just follow the leaderelection/example.py.
Anything else we need to know?:
Go client use ctx.Done() to find out the OnStartedLeading finish, and then release lock:
https://github.com/kubernetes/client-go/blob/1309f64d6648411b4a36a2f7fa84dd8df31884b6/tools/leaderelection/leaderelection.go#L265-L291
Environment:
- Kubernetes version (
kubectl version): v1.20.15 - OS (e.g., MacOS 10.13.6): 10.15.7
- Python version (
python --version): 3.8.10 - Python client version (
pip list | grep kubernetes): 21.7.0
Hi Guys, I am new to this repo. Do you think this issue is good for beginner ?
/help
@Manikkame123 Would be great if you could reproduce this issue
@roycaihw: This request has been marked as needing help from a contributor.
Guidelines
Please ensure that the issue body includes answers to the following questions:
- Why are we solving this issue?
- To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
- Does this issue have zero to low barrier of entry?
- How can the assignee reach out to you for help?
For more details on the requirements of such an issue, please see here and ensure that they are met.
If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.
In response to this:
/help
@Manikkame123 Would be great if you could reproduce this issue
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/test-infra repository.