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

leader stop send heartbeat to follower #781

Closed
david-ealge-han opened this issue Mar 3, 2022 · 1 comment · Fixed by #783
Closed

leader stop send heartbeat to follower #781

david-ealge-han opened this issue Mar 3, 2022 · 1 comment · Fixed by #783
Milestone

Comments

@david-ealge-han
Copy link

david-ealge-han commented Mar 3, 2022

Describe the bug

A clear and concise description of what the bug is.

Expected behavior

leader send heartbeat to follower periodically

Actual behavior

leader stop send heartbeat to follower

Steps to reproduce

Minimal yet complete reproducer code (or GitHub URL to code)

image
image

when try-lock failed, heartbeat error put into the list, may need next unlock to run the heartbeat, so the heartbeat cann't send periodically as expected. this may cause leader vote.

Environment

  • SOFAJRaft version: jraft-core-1.2.7.beta1.jar
  • JVM version (e.g. java -version):
  • OS version (e.g. uname -a):
  • Maven version:
  • IDE version:
@killme2008
Copy link
Contributor

Yep, there is a race condition between

  this.pendingErrors.add(errorCode);

and ThreadId#unlock, so the error signal may be delayed and cause an unnecessary election.

We wil fix it, thank your for your report.

killme2008 added a commit that referenced this issue Mar 4, 2022
@killme2008 killme2008 added this to the 1.4.0 milestone Mar 8, 2022
fengjiachun pushed a commit that referenced this issue Mar 10, 2022
* (fix) refactor ThreadId and fix #781

* (feat) Use ReentrantLock in replicator thread id
fengjiachun pushed a commit that referenced this issue Apr 11, 2022
* (fix) refactor ThreadId and fix #781

* (feat) Use ReentrantLock in replicator thread id
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 a pull request may close this issue.

2 participants