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

Why are election timers still firing after stopped? #3

Open
jasonrogena opened this issue Nov 17, 2019 · 0 comments
Open

Why are election timers still firing after stopped? #3

jasonrogena opened this issue Nov 17, 2019 · 0 comments

Comments

@jasonrogena
Copy link
Owner

Election timers are stopped then started again whenever a heartbeat is received from the leader. It seems the stopped timers still fire.

jasonrogena added a commit that referenced this issue Nov 17, 2019
Switch from using gocron for the election timeout timer, to time.Timer.
This seems to fix the issue causing the timer to stop once a leader is
found.

However, the fix requires we track when last the leader last sent a
heartbeat in all the followers. This is because the timers created using
time.AfterFunc seem to fire even when the timer is stopped.

Fixes #2
Related to #3

Signed-off-by: Jason Rogena <[email protected]>
jasonrogena added a commit that referenced this issue Nov 19, 2019
Switch from using gocron for the election timeout timer, to time.Timer.
This seems to fix the issue causing the timer to stop once a leader is
found.

However, the fix requires we track when last the leader last sent a
heartbeat in all the followers. This is because the timers created using
time.AfterFunc seem to fire even when the timer is stopped.

Fixes #2
Related to #3

Signed-off-by: Jason Rogena <[email protected]>
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

No branches or pull requests

1 participant