-
Notifications
You must be signed in to change notification settings - Fork 5k
ext_proc: buffered mode is not sending local reply with large request #39345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ext_proc: buffered mode is not sending local reply with large request #39345
Conversation
Signed-off-by: Yanjun Xiang <[email protected]>
Signed-off-by: Yanjun Xiang <[email protected]>
Signed-off-by: Yanjun Xiang <[email protected]>
/retest |
/assign @tyxia @stevenzzzz @yanavlasov |
@@ -743,6 +743,9 @@ FilterDataStatus Filter::onData(ProcessorState& state, Buffer::Instance& data, b | |||
// StopIterationAndWatermark as well to stop the ActiveStream from returning error when the | |||
// last chunk added to stream buffer exceeds the buffer limit. | |||
state.setPaused(true); | |||
if (state.bodyMode() == ProcessingMode::BUFFERED) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add some comment here why this special treatment. I think it makes sense in most scenarios, that in happy path, we will buffer the body anyway, so no need to wait for header-response.
But in the rare case that header-response terminates the request already: error, body overrides, we may want to do some clarification here that this branch buffers unnecessarily.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For BUFFERED mode, the API definition is "
// Buffer the message body in memory and send the entire body at once.
// If the body exceeds the configured buffer limit, then the
// downstream system will receive an error.
"
This is regardless how the ext_proc server response will be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the comments.
I tested the fix and could no longer reproduce the behavior 👍 |
Signed-off-by: Yanjun Xiang <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Thanks
Nice root-cause
…envoyproxy#39345) When Envoy is waiting for header response, and new client data arrives Envoy, Envoy should just buffer the data without raising watermarks. Raising watermarks is causing Envoy not sending local reply when the buffer size over the per-connection-limit. Fixes: envoyproxy#39365 --------- Signed-off-by: Yanjun Xiang <[email protected]> Signed-off-by: Ting Pan <[email protected]>
When Envoy is waiting for header response, and new client data arrives Envoy, Envoy should just buffer the data without raising watermarks. Raising watermarks is causing Envoy not sending local reply when the buffer size over the per-connection-limit.
Fixes: #39365