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

Feature/backpressure #764

Merged
merged 9 commits into from
Feb 25, 2022
Merged

Feature/backpressure #764

merged 9 commits into from
Feb 25, 2022

Conversation

killme2008
Copy link
Contributor

@killme2008 killme2008 commented Feb 17, 2022

Motivation:

Right now when the raft node is overloaded, it will trap into error state and can't service any more until restart it by manual. It's not acceptable in many cases.In this PR, i try to improve the backpressure mechanism.

It introduces ApplyTaskMode for Node#apply(task) and Node#readIndex(task) which determins submmitting tasks to node in blocking or non-blocking mode, ApplyTaskMode.NonBlocking by default. In blocking mode, it will block the invocation to these two methods when node is overloaded, and throws OverloadException immediately in non-blocking mode instead.

The PR also Improves disruptor usage in jraft to prevent deadlocking such as #138 #720 etc.

Modification:

Describe the idea and modifications you've done.

Result:

Fixes #754 #720

Doc PR sofastack/sofastack.tech#853

@killme2008 killme2008 requested review from horizonzy, fengjiachun and zongtanghu and removed request for horizonzy and fengjiachun February 17, 2022 04:16
@killme2008
Copy link
Contributor Author

@fengjiachun @horizonzy @zongtanghu 有空再看下

Copy link
Contributor

@fengjiachun fengjiachun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@horizonzy horizonzy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

@fengjiachun fengjiachun merged commit 5de2fbb into master Feb 25, 2022
@fengjiachun fengjiachun deleted the feature/backpressure branch February 25, 2022 06:33
@fengjiachun fengjiachun mentioned this pull request Mar 17, 2022
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

希望能够定制disruptor的提交方式
3 participants