Repository navigation
on_demand: continue to the router when the VHDS vhost has no matching route - #48079
Merged
wbpcode merged 1 commit intoOct 8, 2026
Merged
Conversation
… route Commit Message: continue to the router when the on-demand VHDS virtual host has no matching route. Additional Description: After envoyproxy#47183, onRouteConfigUpdateCompletion() re-runs decodeHeaders() once VHDS reports that the virtual host exists. If none of the routes of the delivered virtual host match the request, decodeHeaders() requests the same virtual host again. Since envoyproxy#46216 that repeated request is not sent, so the request waits until the stream idle timeout. Before envoyproxy#46216 it was sent and answered again, so the request looped on VHDS. The legacy recreateStream() path has the same problem. After refreshing the route config snapshot, the filter now treats the update as resolved only if a route matches, so route_exists means a route was found, as scoped RDS already reports. Otherwise it continues to the router, which replies with a 404. A virtual host that only gains the matching route in a later VHDS update is no longer picked up while the request waits. This case never got an answer before: it looped or hung. Risk Level: low, guarded behavior change limited to on-demand VHDS. Testing: new unit tests in on_demand_filter_test cover both guard values. New integration tests in vhds_integration_test cover both on_demand_vhds_no_recreate_stream values. Without the fix, the new tests with the guard enabled fail and the integration requests time out waiting for a response. on_demand_filter_test, vhds_integration_test, odcds_integration_test and on_demand_integration_test pass. Docs Changes: n/a Release Notes: added (changelogs/current/bug_fixes) Platform Specific Features: n/a Runtime guard: envoy.reloadable_features.on_demand_vhds_require_route_match (default true). Set it to false to restore the previous behavior. Signed-off-by: William Dauchy <[email protected]>
This was referenced Oct 6, 2026
Contributor
Author
|
/retest |
wdauchy
marked this pull request as ready for review
October 6, 2026 19:11
Contributor
Author
|
/retest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit Message: on_demand: continue to the router when the on-demand VHDS virtual host has no matching route.
Additional Description:
After #47183, onRouteConfigUpdateCompletion() re-runs decodeHeaders() once VHDS reports that the
virtual host exists. route_exists only means the virtual host exists, not that one of its routes
matches the request. If none match, decodeHeaders() requests the same virtual host again. Since
#46216 that repeated request is not sent, so the request waits until the stream idle timeout.
Before #46216 it was sent and answered again, so the request looped on VHDS. The legacy
recreateStream() path has the same problem.
This change re-checks route() after refreshing the route config snapshot. route_exists now means
a route was found, as the scoped RDS callback already reports. If no route matches, the filter
continues to the router, which replies with a 404.
Tradeoff: a virtual host that only gains the matching route in a later VHDS update is no longer
picked up while the request waits. Upstream never answered this case before: the request looped
or waited until the stream idle timeout.
Related PRs:
would get an immediate answer for the same virtual host and request it again. Continuing to the
router when no route matches avoids that.
also has no route for the request, the request currently waits until the stream idle timeout.
With this change it gets a 404.
Risk Level: Low. Guarded, limited to on-demand VHDS.
Testing: New unit tests in on_demand_filter_test cover both values of the new guard and of
on_demand_vhds_no_recreate_stream. New integration tests in vhds_integration_test cover both
on_demand_vhds_no_recreate_stream values. Without the fix, the new tests with the guard enabled
fail and the integration requests time out waiting for a response. on_demand_filter_test,
vhds_integration_test, odcds_integration_test and on_demand_integration_test pass.
Docs Changes: N/A
Release Notes: Added under changelogs/current/bug_fixes.
Platform Specific Features: N/A
Runtime guard: envoy.reloadable_features.on_demand_vhds_require_route_match (default true). Set
it to false to restore the previous behavior.
AI assistance: Cursor helped trace the issue and write the tests. I reviewed and understand all
changes.