Skip to content

Commit

Permalink
Ext_proc: Enable sending body without waiting for header response in …
Browse files Browse the repository at this point in the history
…STREAMED mode (#35850)

---------

Signed-off-by: Yanjun Xiang <[email protected]>

Mirrored from https://github.com/envoyproxy/envoy @ 1a153166a6d1e9336ee8982d1a00ba98655c9d39
  • Loading branch information
update-envoy[bot] committed Sep 25, 2024
1 parent b912a71 commit d896bee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
18 changes: 10 additions & 8 deletions envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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 <envoy_v3_api_field_service.ext_proc.v3.ProcessingResponse.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
Expand Down
8 changes: 4 additions & 4 deletions envoy/service/ext_proc/v3/external_processor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ message ProcessingResponse {
// It is also ignored by Envoy when the ext_proc filter config
// :ref:`allow_mode_override
// <envoy_v3_api_field_extensions.filters.http.ext_proc.v3.ExternalProcessor.allow_mode_override>`
// is set to false.
// is set to false, or
// :ref:`send_body_without_waiting_for_header_response
// <envoy_v3_api_field_extensions.filters.http.ext_proc.v3.ExternalProcessor.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
Expand Down Expand Up @@ -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 <envoy_v3_api_field_extensions.filters.http.ext_proc.v3.ExternalProcessor.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
Expand Down

0 comments on commit d896bee

Please sign in to comment.