Skip to content

some function not work in protobuf v5 #2917

Description

@fausturs

我们注意到在1.12.0以上的版本中,brpc已经切换到protobuf v5了。

在我的测试过程中,我注意到有一个小函数可能在升级时被遗漏了。

https://github.com/apache/brpc/blob/master/src/brpc/parallel_channel.h#L121

在我使用protobuf 28.3时,该函数将编译报错。

原因是,New()函数已经不是虚函数,并且NonreflectableMessage定义了该函数的一个重载(arena版本),这时候google::protobuf::Message::New()的实现被隐藏了。

一些继承自NonreflectableMessage的类型,例如(brpc::RedisRequest)调用该Clone函数时,无法调用真正基类中的New()函数定义。即编译错误

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions