From d896beead8777c45ff1988f28db6df69042227bd Mon Sep 17 00:00:00 2001 From: "update-envoy[bot]" <135279899+update-envoy[bot]@users.noreply.github.com> Date: Wed, 25 Sep 2024 23:30:15 +0000 Subject: [PATCH] Ext_proc: Enable sending body without waiting for header response in STREAMED mode (#35850) --------- Signed-off-by: Yanjun Xiang Mirrored from https://github.com/envoyproxy/envoy @ 1a153166a6d1e9336ee8982d1a00ba98655c9d39 --- .../filters/http/ext_proc/v3/ext_proc.proto | 18 ++++++++++-------- .../ext_proc/v3/external_processor.proto | 8 ++++---- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto b/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto index d1a27657..13a24ad9 100644 --- a/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto +++ b/envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto @@ -271,18 +271,20 @@ message ExternalProcessor { // The default value is 5000 milliseconds (5 seconds) if not specified. google.protobuf.Duration deferred_close_timeout = 19; - // [#not-implemented-hide:] // Send body to the side stream server once it arrives without waiting for the header response from that server. // It only works for STREAMED body processing mode. For any other body processing modes, it is ignored. - // // The server has two options upon receiving a header request: - // 1. Instant Response: Send the header response as soon as the header request is received. - // 2. Delayed Response: Wait for the body before sending any response. - // If the server chooses the second option, it has two further choices: - // 2.1 Separate Responses: Send the header response first, followed by separate body responses. - // 2.2 Combined Response: Include both the header response and the first chunk of the body response - // in a single body response message, followed by the remaining body responses. + // + // 1. Instant Response: send the header response as soon as the header request is received. + // + // 2. Delayed Response: wait for the body before sending any response. + // // In all scenarios, the header-body ordering must always be maintained. + // + // If enabled Envoy will ignore the + // :ref:`mode_override ` + // value that the server sends in the header response. This is because Envoy may have already + // sent the body to the server, prior to processing the header response. bool send_body_without_waiting_for_header_response = 21; // When :ref:`allow_mode_override diff --git a/envoy/service/ext_proc/v3/external_processor.proto b/envoy/service/ext_proc/v3/external_processor.proto index 5f0d66e6..6ae58c3c 100644 --- a/envoy/service/ext_proc/v3/external_processor.proto +++ b/envoy/service/ext_proc/v3/external_processor.proto @@ -180,7 +180,10 @@ message ProcessingResponse { // It is also ignored by Envoy when the ext_proc filter config // :ref:`allow_mode_override // ` - // is set to false. + // is set to false, or + // :ref:`send_body_without_waiting_for_header_response + // ` + // is set to true. envoy.extensions.filters.http.ext_proc.v3.ProcessingMode mode_override = 9; // When ext_proc server receives a request message, in case it needs more @@ -285,9 +288,6 @@ message CommonResponse { // Instructions on how to manipulate the headers. When responding to an // HttpBody request, header mutations will only take effect if // the current processing mode for the body is BUFFERED. - // [#comment:TODO(yanjunxiang-google) rephrase last sentence once send_body_without_waiting_for_header_response is not hidden: - // the current processing mode for the body is: 1) BUFFERED; 2) or STREAMED and - // the :ref:`send_body_without_waiting_for_header_response ` is enabled.] HeaderMutation header_mutation = 2; // Replace the body of the last message sent to the remote server on this