OnDemand VHDS makes the first request returns 404.
Description:
I used OnDemand VHDS to dynamically obtain the virtual host configuration. When a request to a certain host comes for the first time, the request of the
routeisnullptr, then theon demand filterwill send a VHDS request, and execute its callbackonRouteConfigUpdateCompletionwhen the VHDS response is received. If the request to the host doesn't have a body, it works fine because a new stream will be created and the request's route will be re-calculated. However if the request has a body, it won't re-create a stream but just continue to next filter, thus the request'srouteis stillnullptrsince thesnapped_route_config_is still the old one. Finally therouterfilter will send a local response of 404 to downstream and set the response flag toNR.
cc @dmitri-d @htuch @lambdai
Ondemand route filter stall the HCM by returning Http::FilterHeadersStatus::StopIteration and recreateStream asynchronously to reevaluate the route. It depends on the functionality of HCM.
Maybe this filter can instead return one of StopAllIterationAndBuffer or StopAllIterationAndWatermark to stop the iteration? I feel a filter prior to this ondemand filter still have the chance to break, but these two is strictly better than StopIteration @alyssawilk Does the above make sense? Is there any other reliable approach to reevaluate route?
On-demand/vhds supports requests without a body only at the moment.
It should be possible to do an internal redirect with a body now, provided envoy.reloadable_features.internal_redirects_with_body has been enabled and the request has been fully read (here: https://github.com/envoyproxy/envoy/blob/main/source/common/http/conn_manager_impl.cc#L1684)? In this case RouteConfig update will need to be initiated from OnDemandRouteUpdate::decodeData() when end_stream is received. @alyssawilk: did I get this right?
Yeah, the router now supports internal redirects with a fully read body (https://github.com/envoyproxy/envoy/pull/15634) but the on demand filter does not yet use that new code (https://github.com/envoyproxy/envoy/blob/main/source/extensions/filters/http/on_demand/on_demand_update.cc#L63)
stopalliteration + explicit read disable might work for HTTP/1.1 downstream but due to how HTTP/2 buffering works, it will still end up with a body buffer and still trip checks in the on demand filter. I think adding support for fully read bodies (as the router filter now has) would be a cleaner next step.
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.
On-demand/vhds supports requests without a body only at the moment.
It should be possible to do an internal redirect with a body now, provided
envoy.reloadable_features.internal_redirects_with_bodyhas been enabled and the request has been fully read (here: https://github.com/envoyproxy/envoy/blob/main/source/common/http/conn_manager_impl.cc#L1684)? In this case RouteConfig update will need to be initiated fromOnDemandRouteUpdate::decodeData()when end_stream is received. @alyssawilk: did I get this right?
is this fixed now ?
is this fixed now ?
How's this going @alyssawilk any progress made on this?
This is unassigned - no one has picked it up thusfar sorry
Hey folks, since this bug has remained unresolved for over three years, I'm curious - how are you working around it to dynamically fetch virtual hosts? cc @alyssawilk @sichan-vonage @maoyutao @uglycow @WeavingGao @dmitri-d If there is no workaround, does this mean there is still no solid approach to NOT require users to predefine their egress dependencies of their service?
Getting this problem fixed is very important to us, which means that we potentially we have funding available if someone with the right skill set wants to come forward with a proposal?? @alyssawilk @sichan-vonage @maoyutao @uglycow @WeavingGao @dmitri-d