envoyproxy / envoyproxy/envoy

InitManager to support dependency based initialization

Ouverte
#3,831 4 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
help wanted tech debt
Langage dominant
C++
Étoiles
28.9k
Forks
5.6k
Merge moyen
1 j 22 h
PR mergées (30 j)
430

Description

*Title*: InitManager to support dependency based initialization

*Description*:
When refactoring ClusterManager to use InitManager, (please see PR https://github.com/envoyproxy/envoy/pull/3700 for the reasons why such refactoring is needed), it will be much easier if InitManager supports dependency based initialization.

Cluster Manager has EDS cluster which may depends on other static clusters. Now it is using fairly complicated primary and secondary list to initialize.
With Added SDS (PR https://github.com/envoyproxy/envoy/pull/3700), it become even more complicated. Even some static clusters may need SDS to download the client secrets and SDS may need another static cluster.

If InitManager supports dependency based initialization, this will be much easier. Each target can specify its dependencies, InitManager will initialize these targets based on the dependency.

Here is the detail design:

Target Interface: {
void initialize() PURE; // existing call
string name(); // the unique target name; for cluster, it can be cluster name.
vector depend_on(); // the depended target names
};

InitManager initialize() call will sort the targets based on the dependency and start to initialize them.

ClusterManager can use InitManager in following way: each cluster (as InitTarget) can find out if it is using any other clusters, if so, use "depends_on()" function to return the depended cluster names.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.