Skip to content

config: ADS plumbing.#1602

Merged
htuch merged 6 commits intoenvoyproxy:masterfrom
htuch:ads-cluster-manager
Sep 8, 2017
Merged

config: ADS plumbing.#1602
htuch merged 6 commits intoenvoyproxy:masterfrom
htuch:ads-cluster-manager

Conversation

@htuch
Copy link
Copy Markdown
Member

@htuch htuch commented Sep 6, 2017

This patch introduces AdsApi, which is where the ADS implementation will go, and AdsSubscription,
that matches between the typed Subscription model and untyped AdsApi interface. AdsApi is placed in
ClusterManager, despite being only dubiously related to ClusterManager, since it is needed early on
and is codependent on ClusterManager. It's also needed at all the xDS instantiation sites where
ClusterManager is.

This patch introduces AdsApi, which is where the ADS implementation will go, and AdsSubscription,
that matches between the typed Subscription model and untyped AdsApi interface. AdsApi is placed in
ClusterManager, despite being only dubiously related to ClusterManager, since it is needed early on
and is codependent on ClusterManager. It's also needed at all the xDS instantiation sites where
ClusterManager is.
* is accepted. Accepted configurations have their version_info reflected in subsequent
* requests.
*/
virtual void onConfigUpdate(const Protobuf::RepeatedPtrField<ProtobufWkt::Any>& resources) PURE;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Won't the exception cause Envoy to terminate if bad config or some incorrect config arrives? Is that the intent?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This will work (in AdsApiImpl) similar to https://github.com/lyft/envoy/blob/master/source/common/config/grpc_subscription_impl.h#L95. I.e. we catch the exception and use that to guide the ACK/NAC of the config.

virtual ~AdsApi() {}

/**
* Start a configuration subscription asynchronously for some API type and resources.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Dumb question: ADS == LDS+CDS+RDS+EDS right? Or can there be different subsets? Is there a usecase for this subdivision?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Any xDS API with a ConfigSource in v2 (which is the APIs you point to) can specify to use ADS to mux, see https://github.com/lyft/envoy-api/blob/master/api/base.proto#L192. So, you can use ADS for only a subset. ADS itself will send requests for all 4 APIs, to support push from the management server, but you don't need to ever send an EDS response if EDS doesn't go over ADS. I'll write up more docs/comments in later PRs as this functionality is implemented.

Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

looks good. One question / one nit.

};

class MockAdsWatch : public AdsWatch {
public:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: define constructor/destructor in CC file (here and below).

/**
* Cancel an ADS watch that was created via AdsApi::subscribe. This will free the AdsWatch object.
*/
virtual void cancel() PURE;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Any particular reason to not have subscribe() return a unique_ptr and destruction of handle deletes watch? Not a big deal, just curious. Slightly easier for the caller.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sure, good idea.

class MockAdsWatch : public AdsWatch {
public:
MockAdsWatch();
virtual ~MockAdsWatch();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: virtual here and below is redundant as base class already has virtual destructor. (Typically we don't do this in code for brevity).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Will clean this up in following PR.

@htuch htuch merged commit adc3008 into envoyproxy:master Sep 8, 2017
@htuch htuch deleted the ads-cluster-manager branch September 8, 2017 01:57
jpsim pushed a commit that referenced this pull request Nov 28, 2022
Description: Add an interface for tracking events that can be used by `EnvoyMobile` to inform platform code (i.e., Android or iOS) about events inside of envoy platform bridge. There are currently no events that are emitted.
Risk Level: Low, additive change
Testing: Manual, integration test
Docs Changes: Done
Release Notes: None

Signed-off-by: Rafal Augustyniak <raugustyniak@lyft.com>
Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit that referenced this pull request Nov 29, 2022
Description: Add an interface for tracking events that can be used by `EnvoyMobile` to inform platform code (i.e., Android or iOS) about events inside of envoy platform bridge. There are currently no events that are emitted.
Risk Level: Low, additive change
Testing: Manual, integration test
Docs Changes: Done
Release Notes: None

Signed-off-by: Rafal Augustyniak <raugustyniak@lyft.com>
Signed-off-by: JP Simard <jp@jpsim.com>
mathetake added a commit that referenced this pull request Mar 3, 2026
**Description**

This decouples Server struct from the tracer implementation.

**Related Issues/PRs (if applicable)**

Preparation for #1083

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
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.

3 participants