-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Error: "Failed to release lock: resource name may not be empty" might occur if ReleaseOnCancel
is true
in leaderelection package
#966
Comments
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closing this issue. In response to this:
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. |
@shihaohems: You can't reopen an issue/PR unless you authored it or you are a collaborator. In response to this:
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. |
Hi @tokers , I'm currently facing the same issue with failure to gracefully release leadership. Do you know if there is a plan to fix this issue or maybe you found a workaround for it? |
Just found that the fix has been already implemented! d04c2ce |
Recently I found there is an exception in leaderelection package.
If the
LeaderElector
was created withReleaseOnCancel: true
, and we cancel the context passed toLeaderElector.Run
by ourselves, errorFailed to release lock: resource name may not be empty
might occur.This is because we canceled the context and make the following operations returning a zero value:
Once they returned, the corresponding object in
ConfigMapLock
,LeaseLock
orEndpointsLock
will be a zero value, whichmetav1.ObjectMeta
is also zeroed. So when therelease
was triggered, the underlying client object returns "resource name may not be empty".I will wait for your replies, and I'd like to submit a PR to fix it.
The text was updated successfully, but these errors were encountered: