kubernetes-client / python-base

Apache License 2.0
70 stars 185 forks source link

leadere lection: release lock when error occour and graceful shotdown #278

Closed fangfenghuang closed 2 years ago

fangfenghuang commented 2 years ago

What happened (please include outputs or screenshots): causes error during shutdown.

INFO:root:leader abd7df1c-1077-48e8-a91c-4dd0243c89b9 has successfully acquired lease INFO:root:abd7df1c-1077-48e8-a91c-4dd0243c89b9 successfully acquired lease I am leader now!!!! INFO:root:Leader has entered renew loop and will try to update lease continuously INFO:root:leader abd7df1c-1077-48e8-a91c-4dd0243c89b9 has successfully acquired lease INFO:root:leader abd7df1c-1077-48e8-a91c-4dd0243c89b9 has successfully acquired lease INFO:root:leader abd7df1c-1077-48e8-a91c-4dd0243c89b9 has successfully acquired lease INFO:root:leader abd7df1c-1077-48e8-a91c-4dd0243c89b9 has successfully acquired lease ^CTraceback (most recent call last): File "leader_main.py", line 38, in leaderelection.LeaderElection(config).run() File "/usr/local/python3/lib/python3.8/site-packages/kubernetes/leaderelection/leaderelection.py", line 64, in run self.renew_loop() File "/usr/local/python3/lib/python3.8/site-packages/kubernetes/leaderelection/leaderelection.py", line 101, in renew_loop time.sleep(retry_period) KeyboardInterrupt

What you expected to happen: release lock when error occour and graceful shotdown

How to reproduce it (as minimally and precisely as possible): example task

roycaihw commented 2 years ago

/assign @fangfenghuang

roycaihw commented 2 years ago

This repo has been merged into the main python repo. We are archiving this repo. Please open a new issue in the main repo. Thanks!

/close

k8s-ci-robot commented 2 years ago

@roycaihw: Closing this issue.

In response to [this](https://github.com/kubernetes-client/python-base/issues/278#issuecomment-1066133219): >This repo has been merged into the main [python repo](https://github.com/kubernetes-client/python). We are archiving this repo. Please open a new issue in the main repo. Thanks! > >/close 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.