Skip to content

Commit 581bee5

Browse files
ext_proc: handle server error response based on the failure_mode_allow config (#39994)
ext_proc: handle server error response based on the failure_mode_allow config. This is to fix: envoyproxy/envoy#38553. If the server returns a spurious response, with failure_mode_allow set to true, the message will be ignored and external processing is closed, and the original request is forwarded to upstream as it is. with failure_mode_allow set to false, local reply is sent to the downstream, and the HTTP stream is reset. --------- Signed-off-by: Yanjun Xiang <[email protected]> Mirrored from https://github.com/envoyproxy/envoy @ ede5b0b15c24eb20f419b675d15ec32333b61980
1 parent 1fd137f commit 581bee5

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

envoy/extensions/filters/http/ext_proc/v3/ext_proc.proto

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,22 @@ message ExternalProcessor {
172172
// :ref:`processing_mode <envoy_v3_api_field_extensions.filters.http.ext_proc.v3.ExternalProcessor.processing_mode>`
173173
// is set to ``FULL_DUPLEX_STREAMED``, ``failure_mode_allow`` can not be set to true.
174174
//
175-
// Otherwise, by default, if the gRPC stream cannot be established, or if it is closed
176-
// prematurely with an error, the filter will fail. Specifically, if the
177-
// response headers have not yet been delivered, then it will return a 500
178-
// error downstream. If they have been delivered, then instead the HTTP stream to the
179-
// downstream client will be reset.
180-
// With this parameter set to true, however, then if the gRPC stream is prematurely closed
181-
// or could not be opened, processing continues without error.
175+
// Otherwise, by default, if in the following cases:
176+
//
177+
// 1. The gRPC stream cannot be established.
178+
//
179+
// 2. The gRPC stream is closed prematurely with an error.
180+
//
181+
// 3. The external processing timeouts.
182+
//
183+
// 4. The ext_proc server sends back spurious response messages.
184+
//
185+
// The filter will fail and a local reply with error code
186+
// 504(for timeout case) or 500(for all other cases), will be sent to the downstream.
187+
//
188+
// However, with this parameter set to true and if the above cases happen, the processing
189+
// continues without error.
190+
//
182191
bool failure_mode_allow = 2;
183192

184193
// Specifies default options for how HTTP headers, trailers, and bodies are

0 commit comments

Comments
 (0)