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

Support backup request policy #2734

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

chenBright
Copy link
Contributor

@chenBright chenBright commented Aug 10, 2024

What problem does this PR solve?

Issue Number: resolve #2668 , resolve #2695

Problem Summary:

What is changed and the side effects?

Changed:

Side effects:

  • Performance effects(性能影响):

  • Breaking backward compatibility(向后兼容性):


Check List:

  • Please make sure your changes are compilable(请确保你的更改可以通过编译).
  • When providing us with a new feature, it is best to add related tests(如果你向我们增加一个新的功能, 请添加相关测试).
  • Please follow Contributor Covenant Code of Conduct.(请遵循贡献者准则).

src/brpc/backup_request_policy.h Outdated Show resolved Hide resolved
src/brpc/backup_request_policy.h Show resolved Hide resolved
@wwbmmm
Copy link
Contributor

wwbmmm commented Aug 26, 2024

LGTM

@@ -1259,6 +1278,11 @@ int Controller::HandleSocketFailed(bthread_id_t id, void* data, int error_code,
cntl->timeout_ms(),
butil::endpoint2str(cntl->remote_side()).c_str());
} else if (error_code == EBACKUPREQUEST) {
BackupRequestPolicy* policy = cntl->_backup_request_policy;
Copy link
Contributor

Choose a reason for hiding this comment

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

我看RetryPolicy和backup重试都是在OnVersionedRPCReturned这个函数里面,没理解为啥这个policy要在这里。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

当时想着就不需要SetFailed和起协程了。但是现在发现BackupRequestPolicy同样有#2419 的问题,所以还是得改成在OnVersionedRPCReturned里面。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yanglimingcn 再看看

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.

支持dynamic_backup_request backup request可以支持下游错误率高于一定阈值时不生效吗?
4 participants