kubernetes-client / python

Official Python client library for kubernetes
http://kubernetes.io/
Apache License 2.0
6.79k stars 3.27k forks source link

leaderelection do not stop leading properly #2075

Open ealyn opened 1 year ago

ealyn commented 1 year ago

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:

Manikkame123 commented 1 year ago

Hi Guys, I am new to this repo. Do you think this issue is good for beginner ?

roycaihw commented 1 year ago

/help

@Manikkame123 Would be great if you could reproduce this issue

k8s-ci-robot commented 1 year ago

@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:

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](https://github.com/kubernetes-client/python/issues/2075): >/help > >@Manikkame123 Would be great if you could reproduce this issue Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.