forked from twitchscience/kinsumer
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add unbecomingLeader flag to avoid race condition in unbecomeLeader(). #8
Comments
colmsnowplow
added a commit
that referenced
this issue
Oct 27, 2021
colmsnowplow
added a commit
that referenced
this issue
Dec 16, 2021
colmsnowplow
added a commit
that referenced
this issue
Dec 16, 2021
colmsnowplow
added a commit
that referenced
this issue
Feb 1, 2022
colmsnowplow
added a commit
that referenced
this issue
Feb 1, 2022
Resolved in #13 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is possible for unbecomeLeader() to be called more than once. If it is called for a second time, while the first is waiting for the waitgroup to finish, then leaderLost will not be nil, and it will attempt to close the leaderLost channel for a second time, resulting in the app panicing.
We can resolve this by adding an
unbecomingLeader
flag to the client. If unbecomingLeader is true, we wait for it to become false before proceeding with theunbecomeLeader()
function.The text was updated successfully, but these errors were encountered: