From 7951082c506b96bce9eaa720bae55682258fbb8e Mon Sep 17 00:00:00 2001 From: "data-plane-api(Azure Pipelines)" Date: Tue, 2 Feb 2021 02:57:37 +0000 Subject: [PATCH] route config: Allow to configure direct response body size (#14778) This patch adds max_direct_response_body_size_bytes to set the maximum bytes of the direct response body size (in bytes). The config is added as a field in RouteConfiguration. Reviving #13487 with a slightly different approach (add the config to RouteConfiguration instead of directly per direct response config entry). Risk Level: Low, since the default behavior is preserved. Testing: Updated to test the newly introduced config. Docs Changes: Updated. Release Notes: Added. Fixes #13422 Signed-off-by: Dhi Aurrahman Mirrored from https://github.com/envoyproxy/envoy @ eeb7adc3a30456f0d4ac65e5e6c8e88e25481d2a --- envoy/config/route/v3/route.proto | 15 ++++++++++++++- envoy/config/route/v4alpha/route.proto | 15 ++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/envoy/config/route/v3/route.proto b/envoy/config/route/v3/route.proto index a528d99b..4588af78 100644 --- a/envoy/config/route/v3/route.proto +++ b/envoy/config/route/v3/route.proto @@ -21,7 +21,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // * Routing :ref:`architecture overview ` // * HTTP :ref:`router filter ` -// [#next-free-field: 11] +// [#next-free-field: 12] message RouteConfiguration { option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.RouteConfiguration"; @@ -106,6 +106,19 @@ message RouteConfiguration { // option. Users may wish to override the default behavior in certain cases (for example when // using CDS with a static route table). google.protobuf.BoolValue validate_clusters = 7; + + // The maximum bytes of the response :ref:`direct response body + // ` size. If not specified the default + // is 4096. + // + // .. warning:: + // + // Envoy currently holds the content of :ref:`direct response body + // ` in memory. Be careful setting + // this to be larger than the default 4KB, since the allocated memory for direct response body + // is not subject to data plane buffering controls. + // + google.protobuf.UInt32Value max_direct_response_body_size_bytes = 11; } message Vhds { diff --git a/envoy/config/route/v4alpha/route.proto b/envoy/config/route/v4alpha/route.proto index 1b805d35..1bddedd3 100644 --- a/envoy/config/route/v4alpha/route.proto +++ b/envoy/config/route/v4alpha/route.proto @@ -21,7 +21,7 @@ option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSIO // * Routing :ref:`architecture overview ` // * HTTP :ref:`router filter ` -// [#next-free-field: 11] +// [#next-free-field: 12] message RouteConfiguration { option (udpa.annotations.versioning).previous_message_type = "envoy.config.route.v3.RouteConfiguration"; @@ -107,6 +107,19 @@ message RouteConfiguration { // option. Users may wish to override the default behavior in certain cases (for example when // using CDS with a static route table). google.protobuf.BoolValue validate_clusters = 7; + + // The maximum bytes of the response :ref:`direct response body + // ` size. If not specified the default + // is 4096. + // + // .. warning:: + // + // Envoy currently holds the content of :ref:`direct response body + // ` in memory. Be careful setting + // this to be larger than the default 4KB, since the allocated memory for direct response body + // is not subject to data plane buffering controls. + // + google.protobuf.UInt32Value max_direct_response_body_size_bytes = 11; } message Vhds {