Fixes #2943 - implements shared grpc connection per multiple EDS subscriptions. #5026
Fixes #2943 - implements shared grpc connection per multiple EDS subscriptions. #5026htuch merged 2 commits intoenvoyproxy:masterfrom dmitri-d:2943-optimize-eds
Conversation
htuch
left a comment
There was a problem hiding this comment.
The basic approach still looks good.. I'm curious why this is constrained to EDS so concretely? I think the same concerns also exist for RDS and possibly SDS. Would it make sense to templatize or something like that?
|
There was a problem hiding this comment.
Nit; std::make_unique is preferred in C++14. Do you need to std::move?
|
🙀 Error while processing event: |
|
@htuch: looks like using emplace instead of insert did the trick. |
There was a problem hiding this comment.
Should this be private? I don't think this is part of the interface.
There was a problem hiding this comment.
It's not part of the interface, but I have tests for it. The only thing I can think of in order to keep tests (which I would like to do) is to subclass EdsSubscriptionFactory in tests and add a proxy method for getOrCreateMux. Would that work?
There was a problem hiding this comment.
Yeah, you can either use a testing peer pattern or provide a public getOrCreateMuxForTests that makes clear this is only to be used in tests (and make the existing implementation private and the target).
There was a problem hiding this comment.
I'm still a bit confused what this is providing over GrpcSubscriptionImpl? They seem to have the same implementation.
There was a problem hiding this comment.
Meant to ask you about this and then forgot. My understanding is that the instance of GrpcMux in GrpcSubscriptionImpl will be deallocated together with the main class. I need to pass a reference to GrpcMux to EdsGrpcSubscriptionImpl, as the mux instances are managed by EdsSubscriptionFactory. Subscription classes are very much the same, but I wasn't sure how to reconcile mux ownership...
There was a problem hiding this comment.
Sure, I think we can refactor this a bit, have a base GrpcSubscriptionImpl that takes a GrpcMux& and then an OwnedGrpcSubscriptionImpl subclass that creates and owns the GrpcMux for those use cases.
There was a problem hiding this comment.
Sure, I think we can refactor this a bit, have a base GrpcSubscriptionImpl that takes a GrpcMux& and then an OwnedGrpcSubscriptionImpl subclass that creates and owns the GrpcMux for those use cases.
test/common/upstream/BUILD
Outdated
There was a problem hiding this comment.
This probably needs buildifier run on it (fix_format).
There was a problem hiding this comment.
Can you add a single line // above each test explaining what it does in natural language?
There was a problem hiding this comment.
I think you are after EXPECT in all these final test statements, and specifically EXPECT_EQ here.
Still need to fix formatting. |
|
There was a problem hiding this comment.
Nit: remove blank lines above/beyond, Google C++ style encourages dense packing of lines except where needed to logically divide up sections.
There was a problem hiding this comment.
We should make https://github.com/envoyproxy/envoy/blob/master/source/common/config/grpc_subscription_impl.h a subclass of this as discussed on Slack.
There was a problem hiding this comment.
A comment explaining what this does would be helpful, motivation, link back to original issue. Also a TODO explaining that it would make sense to generalize this for RDS in the future.
|
|
|
@dmitri-d still some format and tidy changes needed. |
I'll squash and sign-off the commit once the latest changes will have been ok'd. |
|
/retest |
|
🔨 rebuilding |
Signed-off-by: hello-ming <[email protected]>
Signed-off-by: Dmitri Dolguikh <[email protected]>
|
|
/restest |
|
Thanks for the reviews and the merge, @htuch. |
… multiple EDS subscriptions. (envoyproxy#5026)" This reverts commit a085974. Signed-off-by: Adil Hafeez <[email protected]>
…EDS subscriptions. (#5026)" (#5272) This reverts commit a085974. Signed-off-by: Adil Hafeez <[email protected]>
…e EDS subscriptions. (envoyproxy#5026) Fixes envoyproxy#2943 by implementing shared grpc connection per multiple EDS subscriptions. Signed-off-by: Dmitri Dolguikh <[email protected]> Signed-off-by: Fred Douglas <[email protected]>
… multiple EDS subscriptions. (envoyproxy#5026)" (envoyproxy#5272) This reverts commit a085974. Signed-off-by: Adil Hafeez <[email protected]> Signed-off-by: Fred Douglas <[email protected]>
Was originally started in #4823.
Description: Fixes #2943 by implementing shared grpc connection per multiple EDS subscriptions.
Risk Level:
Testing:
Docs Changes:
Release Notes:
[Optional Fixes #Issue]
[Optional Deprecated:]
@htuch: I removed ClusterManager dependency on GrpcMuxFactory, as there was a circular dependency after some recent changed. The extacted code now lives in EdsSubscriptionFactory, and all changes I made are constrained within EDS.