stream info: prefer reference rather than shared pointer for route()#43938
Conversation
|
This bring minor change to interface of StreamInfo, so @ravenblackx @yanavlasov to avoid this affect your forks. (Although I think this won't bring any change to existing code, but in case) |
|
We also have a fork (cilium-proxy), but this change does not seem to affect us. |
Yeah. It should won't affect any source code but may affect the test mock of route() method because now it will return a reference to |
ravenblackx
left a comment
There was a problem hiding this comment.
Thanks for the heads-up. Looks fine to me.
|
/retest |
yanavlasov
left a comment
There was a problem hiding this comment.
LGTM from me. If others feel like this is a serious issue, please comment.
/wait-any
|
After offline discussion. We will migrate to two methods style. :) |
5667cfd
5888f0a to
a19b99b
Compare
|
/retest |
| FilterManager& manager_; | ||
| absl::string_view filter_config_name_; | ||
| Router::RouteConstSharedPtr route_; | ||
| OptRef<const Router::Route> route_; |
There was a problem hiding this comment.
I'm a bit concerned about this one - seems like a place where the shared ownership might be important. Do we know where else owns this route, that definitely has a lifetime exceeding that of a FilterManager?
There was a problem hiding this comment.
Even if it's okay, it's probably worth a comment here explaining who owns it and why we know their lifetime makes it okay to have just a ref here.
There was a problem hiding this comment.
It's not easy to see why it's fine to use ref here on the github diff. But if you read the whole file, you will find the route_ here is a field of FilterChainFactoryCallbacksImpl which is only be used as temporarily object when creating new filter chain.
|
/retest |
Signed-off-by: wbpcode/wangbaiping <wbphub@gmail.com>
Signed-off-by: wbpcode/wangbaiping <wbphub@gmail.com>
Signed-off-by: wbpcode/wangbaiping <wbphub@gmail.com>
48a5c87 to
e49d4ca
Compare
|
This latest commit change nothing but merge main and resolve the conflicts. |
|
/retest |
…nvoyproxy#43938) Commit Message: stream info: return reference rather than copy of shared pointer Additional Description: See envoyproxy#44025 This pr update previous `route()` as `routeSharedPtr()` and add a new `route()` which will return `OptRef<const Route>`. Risk Level: low. Testing: n/a. Docs Changes: n/a. Release Notes: n/a. Platform Specific Features: n/a. --------- Signed-off-by: wbpcode/wangbaiping <wbphub@gmail.com> Signed-off-by: Xuyang Tao <taoxuy@google.com>
…nvoyproxy#43938) Commit Message: stream info: return reference rather than copy of shared pointer Additional Description: See envoyproxy#44025 This pr update previous `route()` as `routeSharedPtr()` and add a new `route()` which will return `OptRef<const Route>`. Risk Level: low. Testing: n/a. Docs Changes: n/a. Release Notes: n/a. Platform Specific Features: n/a. --------- Signed-off-by: wbpcode/wangbaiping <wbphub@gmail.com> Signed-off-by: Jonathan Wu <jtwu@google.com>
…nvoyproxy#43938) Commit Message: stream info: return reference rather than copy of shared pointer Additional Description: See envoyproxy#44025 This pr update previous `route()` as `routeSharedPtr()` and add a new `route()` which will return `OptRef<const Route>`. Risk Level: low. Testing: n/a. Docs Changes: n/a. Release Notes: n/a. Platform Specific Features: n/a. --------- Signed-off-by: wbpcode/wangbaiping <wbphub@gmail.com> Signed-off-by: Nick Shipilov <nick.shipilov.n@gmail.com>
…nvoyproxy#43938) Commit Message: stream info: return reference rather than copy of shared pointer Additional Description: See envoyproxy#44025 This pr update previous `route()` as `routeSharedPtr()` and add a new `route()` which will return `OptRef<const Route>`. Risk Level: low. Testing: n/a. Docs Changes: n/a. Release Notes: n/a. Platform Specific Features: n/a. --------- Signed-off-by: wbpcode/wangbaiping <wbphub@gmail.com>
Commit Message: stream info: return reference rather than copy of shared pointer
Additional Description:
See #44025
This pr update previous
route()asrouteSharedPtr()and add a newroute()which will returnOptRef<const Route>.Risk Level: low.
Testing: n/a.
Docs Changes: n/a.
Release Notes: n/a.
Platform Specific Features: n/a.