envoy
envoy copied to clipboard
buffer_filter: allow to set the maximum size Without buffering data immediately
Commit Message: buffer_filter: allow to set the maximum size Without buffering data immediately Additional Description: Risk Level: Low, doesn't change the default behavior Testing: Unit & Integration Docs Changes: Release Notes: Platform Specific Features: [Optional Runtime guard:] Fixes #32205 [Optional Fixes commit #PR or SHA] [Optional Deprecated:] [Optional API Considerations:]
As a reminder, PRs marked as draft will not be automatically assigned reviewers, or be handled by maintainer-oncall triage.
Please mark your PR as ready when you want it to be reviewed!
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @abeyad
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).
I am blocked by how to run the corresponding test. In the integration test, I used a Lua filter to simulate a filter that buffers the request. However, I get the error C++ exception with the description "Unable to parse JSON as proto (INVALID_ARGUMENT: could not find @type 'type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua'): ....
I have checked that the type of Lua filter is correct. I don't know why this type is not found.
Can anyone help me, please? Thanks!
@abeyad Thanks for your suggestion! Updated.
/wait ci
I am blocked by how to run the corresponding test. In the integration test, I used a Lua filter to simulate a filter that buffers the request. However, I get the error
C++ exception with the description "Unable to parse JSON as proto (INVALID_ARGUMENT: could not find @type 'type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua'): ....I have checked that the type of Lua filter is correct. I don't know why this type is not found.
Can anyone help me, please? Thanks!
@abeyad I have an issue with writing a test to simulate the case that a subsequence filter does the buffering. Would you help me please?
I am blocked by how to run the corresponding test. In the integration test, I used a Lua filter to simulate a filter that buffers the request. However, I get the error
C++ exception with the description "Unable to parse JSON as proto (INVALID_ARGUMENT: could not find @type 'type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua'): .... I have checked that the type of Lua filter is correct. I don't know why this type is not found. Can anyone help me, please? Thanks!@abeyad I have an issue with writing a test to simulate the case that a subsequence filter does the buffering. Would you help me please?
This is probably because the filter isn't linked. Will it be possible to use one of the integration tests filters instead? This will reduce coupling with other filters. Note that adding the filter to the build target (in the BUILD file) is also needed.
@adisuissa Thanks for your suggestion! I will update the test soon.
sorry, is the goal of this PR simply to have a way of calling setDecoderBufferLimit on the filter manager? I don't think it makes sense to add config to the buffer filter for this. Is there a reason you can't use the existing flow control knobs? https://www.envoyproxy.io/docs/envoy/latest/faq/configuration/flow_control /wait
There is a user case that people may want to increase the limit for a separate route. For example, a route that is covered by a WAF rule (which needs the whole request body) may need to increase its limit so no 413 response is triggered unexpectedly. As discussed in https://github.com/envoyproxy/envoy/issues/32205, there is no solution to cover this user case. Using the buffer filter is OK, but it will buffer the whole request unconditionally.
We can also add this feature to a new HTTP filter. One thing I am concerned about is whether adding a new filter for this purpose is overkill. But it is up to you to make the decision.
We already have envoy per-route config https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route.proto I think changing buffer limits makes more sense there than in a filter many may not use.
We already have envoy per-route config https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route.proto I think changing buffer limits makes more sense there than in a filter many may not use.
Do you mean adding a max_request_bytes field to RouteConfiguration message?
something like that yes. cc @envoyproxy/api-shepherds
Will submit a new one with the new method.