Adding a new API for ext_proc server to stop the original timer and start a new timer (#25802)

This can help ext_proc server to extend the timeout value in case it needs more time to process a request in special situations like cold start a WASM module when receives the first request.

Risk level: Low
Testing: Integration tests.

Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>

Mirrored from https://github.com/envoyproxy/envoy @ f23c23e24264bfe0bf9453a071ec7040f79dc347
pull/626/head
data-plane-api(Azure Pipelines) 2 years ago
parent 084aa4a018
commit ed87422da6
  1. 7
      envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto
  2. 18
      envoy/service/ext_proc/v3/external_processor.proto

@ -95,7 +95,7 @@ option (xds.annotations.v3.file_status).work_in_progress = true;
// messages, and the server must reply with
// :ref:`ProcessingResponse <envoy_v3_api_msg_service.ext_proc.v3.ProcessingResponse>`.
// [#next-free-field: 10]
// [#next-free-field: 11]
message ExternalProcessor {
// Configuration for the gRPC service that the filter will communicate with.
// The filter supports both the "Envoy" and "Google" gRPC clients.
@ -163,6 +163,11 @@ message ExternalProcessor {
// :ref:`clear_route_cache <envoy_v3_api_field_service.ext_proc.v3.CommonResponse.clear_route_cache>`
// field to true in the same response.
config.common.mutation_rules.v3.HeaderMutationRules mutation_rules = 9;
// Specify the upper bound of
// :ref:`override_message_timeout <envoy_v3_api_field_service.ext_proc.v3.ProcessingResponse.override_message_timeout>`
// If not specified, by default it is 0, which will effectively disable the ``override_message_timeout`` API.
google.protobuf.Duration max_message_timeout = 10;
}
// Extra settings that may be added to per-route configuration for a

@ -6,6 +6,7 @@ import "envoy/config/core/v3/base.proto";
import "envoy/extensions/filters/http/ext_proc/v3/processing_mode.proto";
import "envoy/type/v3/http_status.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/struct.proto";
import "xds/annotations/v3/status.proto";
@ -121,7 +122,7 @@ message ProcessingRequest {
// For every ProcessingRequest received by the server with the ``async_mode`` field
// set to false, the server must send back exactly one ProcessingResponse message.
// [#next-free-field: 10]
// [#next-free-field: 11]
message ProcessingResponse {
oneof response {
option (validate.required) = true;
@ -170,6 +171,21 @@ message ProcessingResponse {
// may use this to intelligently control how requests are processed
// based on the headers and other metadata that they see.
envoy.extensions.filters.http.ext_proc.v3.ProcessingMode mode_override = 9;
// When ext_proc server receives a request message, in case it needs more
// time to process the message, it sends back a ProcessingResponse message
// with a new timeout value. When Envoy receives this response message,
// it ignores other fields in the response, just stop the original timer,
// which has the timeout value specified in
// :ref:`message_timeout
// <envoy_v3_api_field_extensions.filters.http.ext_proc.v3.ExternalProcessor.message_timeout>`
// and start a new timer with this ``override_message_timeout`` value and keep the
// Envoy ext_proc filter state machine intact.
// Has to be >= 1ms and <=
// :ref:`max_message_timeout <envoy_v3_api_field_extensions.filters.http.ext_proc.v3.ExternalProcessor.max_message_timeout>`
// Such message can be sent at most once in a particular Envoy ext_proc filter processing state.
// To enable this API, one has to set ``max_message_timeout`` to a number >= 1ms.
google.protobuf.Duration override_message_timeout = 10;
}
// The following are messages that are sent to the server.

Loading…
Cancel
Save