composite filter chain cannot handle stop correctly
- Dominant language
- C++
- Stars
- 28.9k
- Forks
- 5.6k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 437
Description
*Title*: *composite filter chain cannot handle stop correctly*
*Description*:
>What issue is being seen? Describe what should be happening instead of
the bug, for example: Envoy should not crash, the expected value isn't
returned, etc.
The composite filter now could support an embedded filters list (a chain). But in current implementation, the multiple filters will be wrapped as a single filter, this result that the stop status couldn't be processed correctly.
For example, when the first filter in the filters list return the stop at the decodeHeaders(), the decodeHeaders() of following filters will not be executed. This is unexpected result.
And because the complexity of body processing, it's super complex to implement a state machine to handle all these statuses.
The only one solution I can thought of now is to evaluate the matcher tree when we initialize the composite filter and add all the evaluated result (filters list/single filter) to the main HTTP filter chain directly.
Because when we initializing the main HTTP filter chain for a request, we have matched the route, so at this time point, it's possible to evaluate the route level/HCM level matcher tree.
The side effect is that:
- Only the initial route could be used by the composite filter and route refreshment cannot affect the composite filter.
*Repro steps*:
> Include sample requests, environment, etc. All data and inputs
required to reproduce the bug.
>**Note**: The [Envoy_collect tool](https://github.com/envoyproxy/envoy/blob/main/tools/envoy_collect/README.md)
gathers a tarball with debug logs, config and the following admin
endpoints: /stats, /clusters and /server_info. Please note if there are
privacy concerns, sanitize the data prior to sharing the tarball/pasting.
*Admin and Stats Output*:
>Include the admin output for the following endpoints: /stats,
/clusters, /routes, /server_info. For more information, refer to the
[admin endpoint documentation.](https://www.envoyproxy.io/docs/envoy/latest/operations/admin)
>**Note**: If there are privacy concerns, sanitize the data prior to
sharing.
*Config*:
>Include the config used to configure Envoy.
*Logs*:
>Include the access logs and the Envoy logs.
>**Note**: If there are privacy concerns, sanitize the data prior to
sharing.
*Call Stack*:
> If the Envoy binary is crashing, a call stack is **required**.
Please refer to the [Bazel Stack trace documentation](https://github.com/envoyproxy/envoy/tree/main/bazel#stack-trace-symbol-resolution).
Contributor guide
Assessment
This issue has not been assessed yet.