wasphin opened a new pull request, #3580:
URL: https://github.com/apache/brpc/pull/3580
### What problem does this PR solve?
Problem Summary:
The protobuf RPC response handlers associate replies with a controller using
the correlation ID without checking the connection used by the matching
request attempt. A reply arriving on another connection can update that
controller, and a stale retry reply can update the response before being
ignored by the call-completion path.
### What is changed and the side effects?
Changed:
- Check the arrival socket against the sending socket before updating the
controller in baidu_std, hulu_pbrpc, sofa_pbrpc, and public_pbrpc.
- Match current attempts and unfinished backup attempts; drop unmatched
replies and release the correlation ID lock.
- Add regression coverage for matching and mismatched sockets, successful
completion after a dropped reply, stale retry replies, and unfinished
backup attempts.
Side effects:
- Performance effects: One request-attempt lookup and socket ID comparison
per response.
- Breaking backward compatibility: None for replies arriving on the request's
sending connection. Direct response injection without a sending socket
remains supported for existing internal callers.
---
### Check List:
- [x] Please make sure your changes are compilable.
- [x] When providing us with a new feature, it is best to add related tests.
- [x] Please follow [Contributor Covenant Code of
Conduct](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]