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

Fix compilation errors of SerializedResponse #2722

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

chenBright
Copy link
Contributor

@chenBright chenBright commented Aug 2, 2024

What problem does this PR solve?

Issue Number: resolve #2721

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.(请遵循贡献者准则).

@wasphin
Copy link
Member

wasphin commented Aug 6, 2024

Protobuf 升级 API 时不时就会不兼容,这个看有没有什么办法做隔离?

@chenBright
Copy link
Contributor Author

chenBright commented Aug 6, 2024

只能跟着Protobuf版本兼容了吧。

@chenBright
Copy link
Contributor Author

chenBright commented Aug 6, 2024

目前bRPC内部继承并实现google::protobuf::Message的原因:

  1. 序列化和打包的时候,通过Protobuf的反射机制来确定request和response具体类型,确保是具体协议要求的类型;
  2. CallMethod要求request和response是google::protobuf::Message类型。

针对这两个问题,或许我们可以通过以下方法来接触对Protobuf的依赖。以下是初步的想法(可能还有其他未关注到得细节):

  1. 实现内部的Message抽象类,并提供必要的反射机制;
  2. 增加CallMethod重载函数,支持内部Message类型;
  3. 协议注册机制支持内部Message类型。

@oathdruid
Copy link
Contributor

unreflectable_message.txt
内部我是尝试整了一个基类归拢了一下和pb的版本适配相关的东西,每次新版本来的,改改倒是也还能用

PS:最近pb的breaking change确实多

@wwbmmm wwbmmm merged commit c709c96 into apache:master Aug 8, 2024
20 checks passed
@chenBright chenBright deleted the fix_serialized_response branch August 8, 2024 10:21
chenBright added a commit to chenBright/brpc that referenced this pull request Aug 10, 2024
@wasphin
Copy link
Member

wasphin commented Oct 8, 2024

unreflectable_message.txt 内部我是尝试整了一个基类归拢了一下和pb的版本适配相关的东西,每次新版本来的,改改倒是也还能用

@oathdruid 这个方便开源出来不?

wasphin added a commit that referenced this pull request Oct 13, 2024
See #2722 (comment)
inspired by unreflectable_message of oathdruid.
wasphin added a commit that referenced this pull request Oct 13, 2024
See #2722 (comment)
inspired by unreflectable_message of oathdruid.
wasphin added a commit that referenced this pull request Oct 13, 2024
See #2722 (comment)
inspired by unreflectable_message of @oathdruid.
wasphin added a commit to wasphin/brpc that referenced this pull request Oct 14, 2024
See apache#2722 (comment)
inspired by unreflectable_message of @oathdruid.
wasphin added a commit to wasphin/brpc that referenced this pull request Oct 14, 2024
wasphin added a commit to wasphin/brpc that referenced this pull request Oct 14, 2024
wasphin added a commit to wasphin/brpc that referenced this pull request Oct 16, 2024
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.

brpc build failed in x64-linux
4 participants