Skip to content

api: Add BufferRequests field to BackendTrafficPolicy#5537

Merged
arkodg merged 7 commits intoenvoyproxy:mainfrom
markwinter:api/buffer-requests
Mar 28, 2025
Merged

api: Add BufferRequests field to BackendTrafficPolicy#5537
arkodg merged 7 commits intoenvoyproxy:mainfrom
markwinter:api/buffer-requests

Conversation

@markwinter
Copy link
Copy Markdown
Contributor

@markwinter markwinter commented Mar 18, 2025

What this PR does / why we need it:

This adds a new field to the BackendTrafficPolicy called BufferRequests.

This field will be used to configure the Buffer filter in Envoy https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/http/buffer/v3/buffer.proto#envoy-v3-api-msg-extensions-filters-http-buffer-v3-buffer

The buffer filter allows Envoy to buffer and fully receive requests from the client before passing them upstream to the backend, so that the backend only receives the full request and is protected from slow clients/attacks. It also imposes a maximum buffer/request size and a request will be rejected if it's too large.

In the implementation, it's planned that depending on whether the targetRef is a Gateway or a HTTPRoute, it will use the Buffer or BufferPerRoute filter.

I could see this not sitting directly in the BackendTrafficPolicy but as part of some sub-struct dealing with Requests, or Buffering instead.

Potentially introduce a Type field to support alpha/not-yet-implemented buffers in the future: filesystem or bufferless

We could also document that the equivalent in nginx is proxy_request_buffering and client_body_buffer_size if thats desired https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_request_buffering

Which issue(s) this PR fixes:

Ref #3706

Release Notes: No

@markwinter markwinter requested a review from a team as a code owner March 18, 2025 13:32
@markwinter markwinter force-pushed the api/buffer-requests branch from d20e877 to c455d3f Compare March 18, 2025 13:33
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.32%. Comparing base (910d209) to head (96da155).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5537      +/-   ##
==========================================
+ Coverage   65.25%   65.32%   +0.06%     
==========================================
  Files         213      213              
  Lines       34073    34073              
==========================================
+ Hits        22235    22258      +23     
+ Misses      10503    10484      -19     
+ Partials     1335     1331       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@markwinter markwinter force-pushed the api/buffer-requests branch from dbf28c8 to a04b3bb Compare March 18, 2025 14:13
@markwinter
Copy link
Copy Markdown
Contributor Author

/retest

@markwinter markwinter force-pushed the api/buffer-requests branch from a04b3bb to 133d08b Compare March 18, 2025 23:19
@jukie
Copy link
Copy Markdown
Contributor

jukie commented Mar 19, 2025

CC @guydc I've closed my PR in favor of this one

@markwinter markwinter force-pushed the api/buffer-requests branch from 133d08b to 96c3505 Compare March 20, 2025 10:56
Copy link
Copy Markdown
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks !

@arkodg arkodg requested review from a team and rudrakhp March 24, 2025 20:59
Signed-off-by: mark winter <mark.winter@thetradedesk.com>
Signed-off-by: mark winter <mark.winter@thetradedesk.com>
Signed-off-by: mark winter <mark.winter@thetradedesk.com>
Signed-off-by: mark winter <mark.winter@thetradedesk.com>
Signed-off-by: mark winter <mark.winter@thetradedesk.com>
Signed-off-by: mark winter <mark.winter@thetradedesk.com>
Signed-off-by: mark winter <mark.winter@thetradedesk.com>
@zirain zirain force-pushed the api/buffer-requests branch from 03abc80 to 96da155 Compare March 28, 2025 00:15
@arkodg arkodg merged commit 555ec03 into envoyproxy:main Mar 28, 2025
26 checks passed
@markwinter markwinter deleted the api/buffer-requests branch April 4, 2025 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants