Add upstream and downstream info in parent read callbacks in tcp too#9949
Add upstream and downstream info in parent read callbacks in tcp too#9949mattklein123 merged 5 commits intoenvoyproxy:masterfrom
Conversation
|
cc @lizan |
|
@lizan , @asraa, @mattklein123 : Can you please review this PR? This is a blocker for TCP telemetry v2 in Istio... |
lizan
left a comment
There was a problem hiding this comment.
What's the difference with read_callbacks_->connection().streamInfo() and getStreamInfo() (stream_info_)? From a quick glance getStreamInfo() is used for access logging purpose, this seems due to a historical reason: to support TCP access logging before we have StreamInfo in Connection interface. Now it seems we can consolidate them. cc @mattklein123
|
@lizan , @mattklein123 : AFAIU, yeah looks like getStreamInfo is maintained just for access logging purposes and we can just maintain one stream info in connection call.. I can volunteer to refactor streaminfo to do that after this PR is in... |
|
Yes please consolidate. We can do it in this PR, it should not be difficult, thanks! /wait |
|
@mattklein123 , @lizan : just want to make sure, that the connection callback(read_callback_) has a longer life span than the TCP filter object(https://sourcegraph.com/github.com/envoyproxy/envoy@master/-/blob/source/common/tcp_proxy/tcp_proxy.cc#L214:1&tab=def) . We access streamInfo on destruction of filter object and after changing to use connection's streaminfo, tcp_proxy access log tests are failing. It could be because I need to implement some stuff in mock streaminfo but just wanted to check before I do that... |
|
I'm sure of the specific issue you are facing but AFAIK the lifetime should be fine as we use this in other filters as well, so I'm guessing it's a test issue. |
|
Thanks for confirming! I am fixing the test right now.
On Tue, Feb 11, 2020 at 9:43 AM Matt Klein ***@***.***> wrote:
I'm sure of the specific issue you are facing but AFAIK the lifetime
should be fine as we use this in other filters as well, so I'm guessing
it's a test issue.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#9949?email_source=notifications&email_token=AI634YRXZXGN6JDK7ORY4Y3RCLPSPA5CNFSM4KRDJJD2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELNMCUQ#issuecomment-584761682>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AI634YTANUB4WQG2FOYJF2DRCLPSPANCNFSM4KRDJJDQ>
.
--
Thanks,
Nupur
|
Ref: istio/istio#20802 Signed-off-by: gargnupur <gargnupur@google.com> Add test Signed-off-by: gargnupur <gargnupur@google.com> Use streaminfo from connection callback as compared to maintaining an extra one just for access logging Signed-off-by: gargnupur <gargnupur@google.com>
6e7654e to
276def2
Compare
|
@mattklein123 , @lizan , @kyessenov : PTAL again.. running tests locally too to see if any more tests need to be changed... |
|
Please check format. /wait |
mattklein123
left a comment
There was a problem hiding this comment.
LGTM at a high level, thanks! I will defer to @lizan for final review/merge.
source/common/tcp_proxy/tcp_proxy.cc
Outdated
| } | ||
|
|
||
| StreamInfo::StreamInfo& Filter::getStreamInfo() { | ||
| ASSERT(read_callbacks_ != nullptr); |
There was a problem hiding this comment.
nit: del as this will crash in an obvious way on the next line.
There was a problem hiding this comment.
Thanks.. Will remove
source/common/tcp_proxy/tcp_proxy.cc
Outdated
|
|
||
| Filter::Filter(ConfigSharedPtr config, Upstream::ClusterManager& cluster_manager, | ||
| TimeSource& time_source) | ||
| Filter::Filter(ConfigSharedPtr config, Upstream::ClusterManager& cluster_manager, TimeSource&) |
There was a problem hiding this comment.
TimeSource& is no longer needed in the signature then?
|
@mattklein123 : Thanks for the review! |
Signed-off-by: gargnupur <gargnupur@google.com>
|
@kyessenov , @mattklein123 , @lizan : the only test that's failing now is the //test/common/upstream:health_checker_impl_test and it's failing at the verification of start time in HttpHealthCheckerImplTest.SuccessServiceCheckWithAdditionalHeaders test case. |
Signed-off-by: gargnupur <gargnupur@google.com>
|
@kyessenov , @mattklein123 , @lizan : Fixed health check test too (for some reason, I was trying same thing before and it was not working :( ) Now, test is more close to what should happen in code too.. PTAL |
|
@lizan : can you please take a look at this? Hoping to get this in before Istio Community Testing on 18th... |
|
@mattklein123 , @lizan : Looks like it didn't get merged by itself, can you please help merge this? |
…nvoyproxy#9949) Signed-off-by: gargnupur <gargnupur@google.com>
…nvoyproxy#9949) Signed-off-by: gargnupur <gargnupur@google.com>
…nvoyproxy#9949) Signed-off-by: gargnupur <gargnupur@google.com>
Add upstream and downstream info in parent read callbacks in tcp too(envoyproxy#9949)
Add upstream and downstream info in parent read callbacks in tcp too
Ref: istio/istio#20802
Signed-off-by: gargnupur gargnupur@google.com
For an explanation of how to fill out the fields, please see the relevant section
in PULL_REQUESTS.md
Description:Add upstream and downstream info in parent read callbacks in tcp too
Http is already doing this because of which in decoder and encoder callbacks can get information like upstream host which is not available in TCP
Risk Level: Low
Testing:
Docs Changes:
Release Notes:
[Optional Fixes #Issue]
[Optional Deprecated:]