Skip to content

WIP: xds mux unification part 2#17049

Closed
dmitri-d wants to merge 21 commits intoenvoyproxy:mainfrom
dmitri-d:xds-unification-part-2
Closed

WIP: xds mux unification part 2#17049
dmitri-d wants to merge 21 commits intoenvoyproxy:mainfrom
dmitri-d:xds-unification-part-2

Conversation

@dmitri-d
Copy link
Contributor

@dmitri-d dmitri-d commented Jun 18, 2021

A follow up to #16486

Dmitri Dolguikh added 21 commits May 13, 2021 09:53
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
…t.cc

Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
@dmitri-d dmitri-d marked this pull request as draft June 18, 2021 20:29
namespace Config {
namespace UnifiedMux {

template <class S, class F, class RQ, class RS>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@htuch: template base class implementation here

// This class owns the GrpcStream used to talk to the server, maintains queuing
// logic to properly order the subscription(s)' various messages, and allows
// starting/stopping/pausing of the subscriptions.
template <class S, class F, class RQ, class RS>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@htuch: template base class definition here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you reduce the number of template parameters by preferring subclassing relationship for things we directly control, like "state" classes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think I can: there's no state interface, for instance, as the base state class is a template with template public methods (getNextRequestAckless and getNextRequestWithAck). B/c state and methods that return state are used in the base mux class, the concrete class must be known at compilation time.

I think this is as small a template-based implementation as it can be, and probably the reason why the original implementation returned pointers to void in getNextRequestAckless and getNextRequestWithAck...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realised I might be able to get away with adding an empty "marker" interface for state classes, and then cast that to an appropriate concrete state class in mux implementations. WDYT, @htuch?

Copy link
Member

@htuch htuch Jun 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not super great, but probably preferable to exploding out template variables. Why is base state a template?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It basically boils down to DeltaDiscovery[Request/Response]Base and sotw Discovery[Request/Response] not having a common base class. In the original implementation SubscriptionState methods that returned requests/responses or accepted them as parameters were using pointers to void. These have now been changed to templates (here, for example: https://github.com/envoyproxy/envoy/pull/16486/files#diff-ec4538b5bf47eacd7205e605ae59723bbef2a554ac9eae0697a6ab36d1fd1c8fR60).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I think maybe consider this a request to do what's possible without gymnastics to minimize templates and template variable count within a template where possible. Do the least bad option ;-)

@alyssawilk
Copy link
Contributor

Just to be aware, we've been making some improvements to Envoy tooling for more prompt reviews, but draft PRs are not included in the tooling. I'm updating the contribution guidelines to make that clear (https://github.com/envoyproxy/envoy/pull/17063/files) , but as this PR predates the repokitteh warning I just want to call out that draft PRs are likely not going to get fast turnaround. Please consider marking this as ready for review if it stalls, and you want the assignee to take a look!

@dmitri-d
Copy link
Contributor Author

Closing in favour of #17352

@dmitri-d dmitri-d closed this Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants