area/configurationdesign proposalhelp wanted
Metriche repository
- Star
- (27.997 star)
- Metriche merge PR
- (Merge medio 8g) (378 PR mergiate in 30 g)
Descrizione
Title: allow extension factories to be asynchronous
Context:
- at the moment, extension factories must implement a synchronous
create*(config)method, assuming that a given configuration itself is enough to return a ready-to-use extension instance or*FactoryCb. E.g.envoy.access_loggers:AccessLog::InstanceSharedPtr createAccessLogInstance(config)envoy.filters.http:Http::FilterFactoryCb createFilterFactoryFromProto(config)envoy.filters.network:Network::FilterFactoryCb createFilterFactoryFromProto(config)envoy.filters.listener:Network::ListenerFilterFactoryCb createListenerFilterFactoryFromProto(config)- etc
Problem:
- in the context of
Wasmextensions, config object itself is not enough to return a ready-to-use extension instance or*FactoryCb, e.g.Wasmcode needs to be loaded from a remote locationWasmextension is allowed to define_start/proxy_on_vm_start/proxy_on_configurecallbacks that, in a general case, might need to use async Envoy API, such asHTTP Client/gRPC Client
- right now,
envoy.access_loggers.wasm,envoy.filters.network.wasmandenvoy.filters.http.wasmimplementcreate*(config)method in a way that lets Envoy to proceed and start serving requests even thoughWasmextension has not been loaded, configured and warmed yet
Proposal:
- change extension factory interfaces to return a
Future/Promiseinstead of a ready-to-use object - it will give
Wasmextensions flexibility in deciding when they are ready-to-use - it will make
Envoybehaviour consistent - the enclosing object (e.g.,Listener) will remain in thewarmingstate until all extensions are actually ready-to-use - it will simplify user/operator experience with
wasmextensions. It's a burden for users to decide whether it's ok to serve requests while the extension is not ready yet. Just don't serve the requests until configuration is complete.