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

关于Timer.Reset的使用 #23

Open
CHYhave opened this issue Nov 22, 2024 · 1 comment
Open

关于Timer.Reset的使用 #23

CHYhave opened this issue Nov 22, 2024 · 1 comment

Comments

@CHYhave
Copy link

CHYhave commented Nov 22, 2024

先叠个甲,是个go的初学者,如果有错误请轻喷
代码主要参考了作者的实现。
下图是在执行TestReElection2A时产生的日志,可见在disconnect第一个term的leader后,S1当选了Term2的leader,并发送了心跳。此时讲道理S2应该重置electionTime,但是S2在接受到心跳后仍然触发了ElectionTimeout事件。怀疑是在Reset前,就已经产生了electiontimeout,但就日志结果而言,接受心跳发生在electiontimeout前,理应被reset掉。

截屏2024-11-22 下午4 10 37
@CHYhave
Copy link
Author

CHYhave commented Nov 22, 2024

不知道作者在实现LabA时候有遇到这个问题吗?

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