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 sure revokeLeadership is called if establishLeadership errors #3909

Merged
merged 3 commits into from
Feb 21, 2018

Conversation

preetapan
Copy link
Contributor

This PR ports over a fix from @dadgar in Nomad (hashicorp/nomad#3890) that leaves partially initialized state around when the establishLeadership method returns an error. This caused us to not call revokeLeadership if there was an event in the stop channel (losing leadership).

This, combined with #3908 makes sure that revokeLeadership is idempotent.

Copy link
Contributor

@kyhavlov kyhavlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

defer os.RemoveAll(dir1)
defer s1.Shutdown()


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra newline here

@preetapan preetapan merged commit 68dc2ee into master Feb 21, 2018
@banks banks deleted the b-leaderloop-revokeonerror branch February 22, 2018 13:56
@pearkes pearkes added this to the 1.0.7 milestone Mar 13, 2018
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

Successfully merging this pull request may close these issues.

3 participants