Repository navigation
disable recreateStream for successful On Demand CDS. - #43163
Conversation
Signed-off-by: Paul Ogilby <[email protected]>
adisuissa
left a comment
There was a problem hiding this comment.
Overall LGTM, thanks!
Left a couple of minor comments.
| // tests onClusterDiscoveryCompletion when a cluster is available, but recreating a stream failed | ||
| TEST_F(OnDemandFilterTest, OnClusterDiscoveryCompletionClusterFoundRecreateStreamFailed) { | ||
| TestScopedRuntime scoped_runtime; | ||
| scoped_runtime.mergeValues( |
There was a problem hiding this comment.
It is unclear what should be done with these tests once the runtime flag is deprecated. I don't think the tests should disappear, so it makes sense to fix them as part of this PR.
There was a problem hiding this comment.
I actually think they should go away, as the dependency on data being present or not will no longer matter after these changes go through.
The test with a "what happens if recreateStream fails" should definitely go away after this flag is removed.
There was a problem hiding this comment.
I think it's fine to delete those tests since they depend on recreateStream behavior.
|
/retest |
| } | ||
|
|
||
| // tests onClusterDiscoveryCompletion when a cluster is available | ||
| TEST_F(OnDemandFilterTest, OnClusterDiscoveryCompletionClusterFoundNoRecreateStream) { |
There was a problem hiding this comment.
Is this a replacement for OnClusterDiscoveryCompletionClusterFound?
If so, can you add a comment clarifying what to do when deprecating the runtime flag.
|
Oh, just saw @kyessenov comment. He is the codeowner, so if he is happy with the modified tests, LGTM. |
|
/wait Please duplicate the test so we can remove one when it's time to delete the flag. |
Signed-off-by: Paul Ogilby <[email protected]>
Signed-off-by: Paul Ogilby <[email protected]>
|
/retest |
|
/retest |
Signed-off-by: Paul Ogilby <[email protected]>
Commit Message: disable recreate stream for successful On Demand CDS. Additional Description: Before this change, when non-idempotent filters appear before the on-demand filter, they would be triggered twice, potentially causing unwanted behavior. This change make it so that by default, a successful CDS response as triggered by the on demand filter will just cause the filter chain to continue iterating through subsequent filters, rather than restarting the stream. Risk Level: moderate, this is a behavior change. Testing: unit, integration. Docs Changes: Release Notes: added AI Usage: Gemini partially generated these changes. --------- Signed-off-by: Paul Ogilby <[email protected]>
Commit Message: disable recreate stream for successful On Demand CDS. Additional Description: Before this change, when non-idempotent filters appear before the on-demand filter, they would be triggered twice, potentially causing unwanted behavior. This change make it so that by default, a successful CDS response as triggered by the on demand filter will just cause the filter chain to continue iterating through subsequent filters, rather than restarting the stream. Risk Level: moderate, this is a behavior change. Testing: unit, integration. Docs Changes: Release Notes: added AI Usage: Gemini partially generated these changes. --------- Signed-off-by: Paul Ogilby <[email protected]> Signed-off-by: Gustavo <[email protected]>
Commit Message: disable recreateStream for successful on-demand VHDS. Additional Description: This mirrors the on-demand CDS fix in envoyproxy#43163 for the VHDS path. Before this change, when OnDemandRouteUpdate::onRouteConfigUpdateCompletion resolved a previously-missing virtual host, recreateStream(nullptr) was invoked, which (a) re-runs the entire filter chain, double-triggering non-idempotent filters sitting before the on_demand filter, and (b) reaches ActiveStream::recreateStream -> Buffer::OwnedImpl::move on the buffered request body. That buffer can be a sub-iteration zombie when the downstream stream was reset while VHDS was in flight, producing a remote-reachable crash (fault at 0x0 inside move) -- the same null-deref signature as the ODCDS crash fixed by envoyproxy#43163. With this change the VHDS callback continues decoding the existing stream instead. To make continueDecoding route to the freshly-discovered virtual host, a new StreamFilterCallbacks method refreshRouteConfigSnapshot() re-snaps snapped_route_config_ from the route config provider. Without this re-snap the resumed router lookup resolves against the pre-VHDS snapshot taken at request start and 404s. The ODCDS sibling does not need this because cluster lookup goes through getThreadLocalCluster() per request rather than the per-stream route snapshot. The new path is gated by envoy.reloadable_features.on_demand_vhds_no_recreate_stream (default true), mirroring envoy.reloadable_features.on_demand_cluster_no_recreate_stream. Set the guard to false to restore the legacy recreate behavior. Risk Level: moderate, this is a guarded behavior change. Testing: unit (on_demand_filter_test), integration (vhds_integration_test). Docs Changes: n/a Release Notes: added (changelogs/current/behavior_changes) Platform Specific Features: n/a Signed-off-by: William Dauchy <[email protected]>
Commit Message: disable recreateStream for successful on-demand VHDS. Additional Description: This mirrors the on-demand CDS fix in envoyproxy#43163 for the VHDS path. Before this change, when OnDemandRouteUpdate::onRouteConfigUpdateCompletion resolved a previously-missing virtual host, recreateStream(nullptr) was invoked, which (a) re-runs the entire filter chain, double-triggering non-idempotent filters sitting before the on_demand filter, and (b) reaches ActiveStream::recreateStream -> Buffer::OwnedImpl::move on the buffered request body. That buffer can be a sub-iteration zombie when the downstream stream was reset while VHDS was in flight, producing a remote-reachable crash (fault at 0x0 inside move) -- the same null-deref signature as the ODCDS crash fixed by envoyproxy#43163. With this change the VHDS callback continues decoding the existing stream instead. To make continueDecoding route to the freshly-discovered virtual host, a new StreamFilterCallbacks method refreshRouteConfigSnapshot() re-snaps snapped_route_config_ from the route config provider. Without this re-snap the resumed router lookup resolves against the pre-VHDS snapshot taken at request start and 404s. The ODCDS sibling does not need this because cluster lookup goes through getThreadLocalCluster() per request rather than the per-stream route snapshot. The new path is gated by envoy.reloadable_features.on_demand_vhds_no_recreate_stream (default true), mirroring envoy.reloadable_features.on_demand_cluster_no_recreate_stream. Set the guard to false to restore the legacy recreate behavior. Risk Level: moderate, this is a guarded behavior change. Testing: unit (on_demand_filter_test), integration (vhds_integration_test). Docs Changes: n/a Release Notes: added (changelogs/current/behavior_changes) Platform Specific Features: n/a Signed-off-by: William Dauchy <[email protected]>
Commit Message: disable recreateStream for successful on-demand VHDS. Additional Description: This mirrors the on-demand CDS fix in envoyproxy#43163 for the VHDS path. Before this change, when OnDemandRouteUpdate::onRouteConfigUpdateCompletion resolved a previously-missing virtual host, recreateStream(nullptr) was invoked, which (a) re-runs the entire filter chain, double-triggering non-idempotent filters sitting before the on_demand filter, and (b) reaches ActiveStream::recreateStream -> Buffer::OwnedImpl::move on the buffered request body. That buffer can be a sub-iteration zombie when the downstream stream was reset while VHDS was in flight, producing a remote-reachable crash (fault at 0x0 inside move) -- the same null-deref signature as the ODCDS crash fixed by envoyproxy#43163. With this change the VHDS callback continues decoding the existing stream instead. To make continueDecoding route to the freshly-discovered virtual host, a new StreamFilterCallbacks method refreshRouteConfigSnapshot() re-snaps snapped_route_config_ from the route config provider. Without this re-snap the resumed router lookup resolves against the pre-VHDS snapshot taken at request start and 404s. The ODCDS sibling does not need this because cluster lookup goes through getThreadLocalCluster() per request rather than the per-stream route snapshot. The new path is gated by envoy.reloadable_features.on_demand_vhds_no_recreate_stream (default true), mirroring envoy.reloadable_features.on_demand_cluster_no_recreate_stream. Set the guard to false to restore the legacy recreate behavior. Risk Level: moderate, this is a guarded behavior change. Testing: unit (on_demand_filter_test), integration (vhds_integration_test). Docs Changes: n/a Release Notes: added (changelogs/current/behavior_changes) Platform Specific Features: n/a Signed-off-by: William Dauchy <[email protected]>
Commit Message: disable recreateStream for successful on-demand VHDS. Additional Description: This mirrors the on-demand CDS fix in envoyproxy#43163 for the VHDS path. Before this change, when OnDemandRouteUpdate::onRouteConfigUpdateCompletion resolved a previously-missing virtual host, recreateStream(nullptr) was invoked, which (a) re-runs the entire filter chain, double-triggering non-idempotent filters sitting before the on_demand filter, and (b) reaches ActiveStream::recreateStream -> Buffer::OwnedImpl::move on the buffered request body. That buffer can be a sub-iteration zombie when the downstream stream was reset while VHDS was in flight, producing a remote-reachable crash (fault at 0x0 inside move), the same null-deref signature as the ODCDS crash fixed by envoyproxy#43163. With this change the VHDS callback continues decoding the existing stream instead. To make continueDecoding route to the freshly-discovered virtual host, a new StreamFilterCallbacks method refreshRouteConfigSnapshot() re-snaps snapped_route_config_ from the route config provider. Without this re-snap the resumed router lookup resolves against the pre-VHDS snapshot taken at request start and 404s. The ODCDS sibling does not need this because cluster lookup goes through getThreadLocalCluster() per request rather than the per-stream route snapshot. The new path is gated by envoy.reloadable_features.on_demand_vhds_no_recreate_stream (default true), mirroring envoy.reloadable_features.on_demand_cluster_no_recreate_stream. Set the guard to false to restore the legacy recreate behavior. Risk Level: moderate, this is a guarded behavior change. Testing: unit (on_demand_filter_test), integration (vhds_integration_test). Docs Changes: n/a Release Notes: added (changelogs/current/behavior_changes) Platform Specific Features: n/a Signed-off-by: William Dauchy <[email protected]>
Commit Message: disable recreateStream for successful on-demand VHDS. Additional Description: This mirrors the on-demand CDS fix in #43163 for the VHDS path. Before this change, when OnDemandRouteUpdate::onRouteConfigUpdateCompletion resolved a previously-missing virtual host, recreateStream(nullptr) was invoked, which re-runs the entire filter chain, so non-idempotent filters sitting before the on_demand filter run twice. With this change the VHDS callback continues decoding the existing stream instead. A crash in recreateStream() on this path was also observed in production and is avoided as well. To make continueDecoding route to the freshly-discovered virtual host, a new StreamFilterCallbacks method refreshRouteConfigSnapshot() re-snaps snapped_route_config_ from the route config provider. Without this re-snap the resumed router lookup resolves against the pre-VHDS snapshot taken at request start and 404s. The ODCDS sibling does not need this because cluster lookup goes through getThreadLocalCluster() per request rather than the per-stream route snapshot. The new path is gated by envoy.reloadable_features.on_demand_vhds_no_recreate_stream (default true), mirroring envoy.reloadable_features.on_demand_cluster_no_recreate_stream. Set the guard to false to restore the legacy recreate behavior. Risk Level: moderate, this is a guarded behavior change. Testing: unit (on_demand_filter_test), integration (vhds_integration_test). Docs Changes: n/a Release Notes: added (changelogs/current/behavior_changes) Platform Specific Features: n/a --------- Signed-off-by: William Dauchy <[email protected]> Signed-off-by: code <[email protected]> Co-authored-by: code <[email protected]>
…code paths (#48559) Commit Message: runtime: remove on_demand_cluster_no_recreate_stream flag and legacy code paths Additional Description: The guard was added in #43163 (2026-01). This removes it and the legacy code path, so a completed on-demand cluster discovery always continues decoding instead of recreating the stream. The guard-disabled unit tests and the OnDemandClusterDiscoveryWorksWithRecreateStream integration test are removed, and the explicit overrides are dropped from the remaining tests. Risk Level: Low Testing: unit. Docs Changes: N/A Release Notes: Added. Runtime guard: Removed envoy.reloadable_features.on_demand_cluster_no_recreate_stream Signed-off-by: wbpcode <[email protected]>
Commit Message: disable recreate stream for successful On Demand CDS.
Additional Description: Before this change, when non-idempotent filters appear before the on-demand filter, they would be triggered twice, potentially causing unwanted behavior. This change make it so that by default, a successful CDS response as triggered by the on demand filter will just cause the filter chain to continue iterating through subsequent filters, rather than restarting the stream.
Risk Level: moderate, this is a behavior change.
Testing: unit, integration.
Docs Changes:
Release Notes: added
AI Usage: Gemini partially generated these changes.