Open uglycow opened 2 years ago
Do you also use RDS or SRDS? I think the on-demand does not work when both are in use: https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/on_demand_updates_filter
@yanavlasov at first, we are using rds, but we get "envoy_apply_resources_failed vhds: only 'DELTA_GRPC' is supported as an api_type". so we remove the rds and found that the vhds request is not sent.
@yanavlasov
seems like envoy only send vhds request when we get a RouteConfiguration through rds.
// Schedules a VHDS request on the main thread and queues up the callback to use when the VHDS
// response has been propagated to the worker thread that was the request origin.
void RdsRouteConfigProviderImpl::requestVirtualHostsUpdate(
const std::string& for_domain, Event::Dispatcher& thread_local_dispatcher,
std::weak_ptr<Http::RouteConfigUpdatedCallback> route_config_updated_cb) {
auto alias = VhdsSubscription::domainNameToAlias(
config_update_info_->protobufConfigurationCast().name(), for_domain);
// The RdsRouteConfigProviderImpl instance can go away before the dispatcher has a chance to
// execute the callback. still_alive shared_ptr will be deallocated when the current instance of
// the RdsRouteConfigProviderImpl is deallocated; we rely on a weak_ptr to still_alive flag to
// determine if the RdsRouteConfigProviderImpl instance is still valid.
factory_context_.mainThreadDispatcher().post([this,
maybe_still_alive =
std::weak_ptr<bool>(still_alive_),
alias, &thread_local_dispatcher,
route_config_updated_cb]() -> void {
if (maybe_still_alive.lock()) {
subscription().updateOnDemand(alias);
config_update_callbacks_.push_back({alias, thread_local_dispatcher, route_config_updated_cb});
}
});
}
if we skip rds and configure vhds statically, envoy won't do anything for vhds. requestVirtualHostsUpdate is an empty method for StaticRouteConfigProviderImpl.
/**
* Implementation of RouteConfigProvider that holds a static route configuration.
*/
class StaticRouteConfigProviderImpl : public RouteConfigProvider {
public:
StaticRouteConfigProviderImpl(const envoy::config::route::v3::RouteConfiguration& config,
Rds::ConfigTraits& config_traits,
Server::Configuration::ServerFactoryContext& factory_context,
Rds::RouteConfigProviderManager& route_config_provider_manager);
~StaticRouteConfigProviderImpl() override;
// Router::RouteConfigProvider
Rds::ConfigConstSharedPtr config() const override { return base_.config(); }
const absl::optional<ConfigInfo>& configInfo() const override { return base_.configInfo(); }
SystemTime lastUpdated() const override { return base_.lastUpdated(); }
void onConfigUpdate() override { base_.onConfigUpdate(); }
ConfigConstSharedPtr configCast() const override;
void requestVirtualHostsUpdate(const std::string&, Event::Dispatcher&,
std::weak_ptr<Http::RouteConfigUpdatedCallback>) override {}
private:
Rds::StaticRouteConfigProviderImpl base_;
Rds::RouteConfigProviderManager& route_config_provider_manager_;
};
does anybody know if this is a bug or expected?
@adisuissa @htuch for comments
Yeah, looks like this was never implemented for static VHDS configuration, I would mark this as an enhancement and help wanted.
Any progress on this?
If you are reporting any crash or any potential security issue, do not open an issue in this repo. Please report the issue via emailing envoy-security@googlegroups.com where the issue will be triaged appropriately.
Title: envoy doesn't send vhds request to xds
Description:
Repro steps:
Admin and Stats Output:
Config:
dynamic_resources: ads_config: api_type: DELTA_GRPC transport_api_version: V3 grpc_services:
Logs:
sorry that log from docker-compose is not well formatted.
according to the log, envoy received the request, but didn't send vhds and the request just failed with DeadlineExceeded Error.
Call Stack: