zchuango opened a new pull request, #3514: URL: https://github.com/apache/brpc/pull/3514
### What problem does this PR solve? Issue Number: resolve #3372 Problem Summary: `SelectiveChannel` uses protobuf reflection to swap a successful sub-call response back to the main response. For non-reflectable messages such as `RedisResponse`, `GetReflection()` is unavailable, which may lead to a null pointer dereference and crash. ### What is changed and the side effects? Changed: - Add a common interface for `NonreflectableMessage` to copy responses of the same type without protobuf reflection. - Use the non-reflectable copy path in `SelectiveChannel`, while keeping the existing reflection-based `Swap` for normal protobuf messages. - Add protobuf 29+ `MessageCreator` support so `Message::New()` can create non-reflectable responses correctly. - Add a Redis-backed regression test for using `RedisResponse` with `SelectiveChannel`. Side effects: - Performance effects: No significant performance impact is expected. The additional type check only occurs when transferring the completed sub-call response. - Breaking backward compatibility: No. The existing reflection-based path for normal protobuf messages remains unchanged. --- ### 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](https://github.com/apache/brpc/blob/master/CODE_OF_CONDUCT.md)](https://github.com/apache/brpc/blob/master/CODE_OF_CONDUCT.md). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
