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

(feat) Refused requests when node is overload, #138 #144

Merged
merged 7 commits into from
May 7, 2019

Conversation

killme2008
Copy link
Contributor

Motivation:

Fix #138 , refused new requests when the raft node is overload.

Modification:

  • Adds DisruptorBuilder to build disruptor, refactor code.
  • Use tryPublishEvent to replace publishEvent in NodeImpl#apply and ReadOnlyServiceImpl#addRequest to defense overload requests.
  • Use TimeoutBlockingWaitStrategy for LogManagerImpl disruptor, when diskQueue is overload, it will wait at most 10 seconds(setting by RaftOptions#disruptorPublishEventWaitTimeoutSecs) to put new event. If timed out, the node will be halt.
  • Some minor changes to avoid dead lock.
  • Adds a test NodeTest#testNodeTaskOverload

fengjiachun and others added 3 commits May 6, 2019 08:36
* (feat) Auto select Thread.onSpinWait instead of Thread.yield when above jdk9

* (fix) insure that we always have a spinner

* (fix) code format

* (fix) insure that we always have a spinner
@fengjiachun fengjiachun merged commit 14181e8 into master May 7, 2019
@fengjiachun fengjiachun deleted the feature/process-overload branch May 7, 2019 07:46
@fengjiachun fengjiachun mentioned this pull request Aug 15, 2019
4 tasks
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.

JRaft死锁BUG。。。
2 participants