Copilot commented on code in PR #3421:
URL: https://github.com/apache/brpc/pull/3421#discussion_r3695970718
##########
src/brpc/controller.h:
##########
@@ -877,7 +877,7 @@ friend void policy::ProcessThriftRequest(InputMessageBase*);
private:
// NOTE: align and group fields to make Controller as compact as possible.
- std::weak_ptr<Span> _span;
+ std::shared_ptr<Span> _span;
Review Comment:
This change fixes rpcz span lifetime behavior, but there’s no regression
unit test covering the original failure mode (root client span created without
a local parent should remain alive after the caller-side temporary shared_ptr
is released, until SubmitSpan/Reset). Adding a focused unit test would help
prevent future refactors from reintroducing the weak_ptr lifetime bug.
--
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]