envoyproxy/envoy

InitManager to support dependency based initialization

Open

#3.831 aberto em 10 de jul. de 2018

Ver no GitHub
 (4 comments) (0 reactions) (0 assignees)C++ (5.373 forks)batch import
help wantedtech debt

Métricas do repositório

Stars
 (27.997 stars)
Métricas de merge de PR
 (Mesclagem média 8d) (378 fundiu PRs em 30d)

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.

Guia do colaborador