Repository navigation
ext_proc: Implement STREAMED body processing mode - #17069
Conversation
Signed-off-by: Gregory Brail <[email protected]>
Signed-off-by: Gregory Brail <[email protected]>
Signed-off-by: Gregory Brail <[email protected]>
Signed-off-by: Gregory Brail <[email protected]>
Signed-off-by: Gregory Brail <[email protected]>
Signed-off-by: Gregory Brail <[email protected]>
Signed-off-by: Gregory Brail <[email protected]>
htuch
left a comment
There was a problem hiding this comment.
Thanks, this is super cool.
/wait
|
@ikepolinsky would appreciate your take on this PR; since you will be writing the fuzzing against this, it's probably a good idea to make sure it's testable and matches your understanding. |
|
Thanks for your comments -- I have some improvements I'm working on but I have one test failure to address before they're ready. |
Clarify "streaming integration test" by using standard assert macros and with some comments. Fix bugs that happen when streamed message bodies are prematurely closed or have their processing mode changed. Reduce the amount of watermarking the filter does in streamed mode. Signed-off-by: Gregory Brail <[email protected]>
Signed-off-by: Gregory Brail <[email protected]>
Signed-off-by: Gregory Brail <[email protected]>
htuch
left a comment
There was a problem hiding this comment.
Sorry about the delay, holiday week.
/wait
Signed-off-by: Gregory Brail <[email protected]>
Signed-off-by: Gregory Brail <[email protected]>
Signed-off-by: Gregory Brail <[email protected]>
htuch
left a comment
There was a problem hiding this comment.
Thanks, this reads well to me now, the only two things before shipping are nits and maybe getting some better docs on the thread around HTTP filter chain resumption while chunks are out for processing.
Signed-off-by: Gregory Brail <[email protected]>
Signed-off-by: Gregory Brail <[email protected]>
|
The original discussion about how to do this was covered in #16760 and with this PR, that issue can be closed. |
Implement this mode, which allows an external processor to receive the body one chunk at a time and examine or modify the body while it is being processed. Risk Level: Medium. The mode is only engaged if used. However an external processor must be coded carefully, particularly if it expects to stream both request and response bodies simultaneously, since each will proceed in its own ordering. Testing: New unit and integration tests. Docs Changes: Updated proto docs to reflect that the mode is now supported. Release Notes: External processing servers may now use the STREAMED processing mode. In this mode, chunks of the body are forwarded to the external processing server when they arrive. Depending on how the upstream system is implemented, request body chunks may be delivered before or after the response headers, and request and response body chunks may be interleaved if the upstream system delivers them that way. An external processor should be carefully coded so that it does not assume that a particular ordering will be implemented. Signed-off-by: Gregory Brail <[email protected]>
|
@gbrail do you have a working example of Streamed mode working I'm not able to make it work even on the most basic example... only on buffered mode |
Commit Message: Implement STREAMED body processing mode in ext_proc
Additional Description: Implement this mode, which allows an external processor to receive the body one chunk at a time and examine or modify the body while it is being processed.
Risk Level: Medium. The mode is only engaged if used. However an external processor must be coded carefully, particularly if it expects to stream both request and response bodies simultaneously, since each will proceed in its own ordering.
Testing: New unit and integration tests.
Docs Changes: Updated proto docs to reflect that the mode is now supported.
Release Notes: External processing servers may now use the STREAMED processing mode. In this mode, chunks of the body are forwarded to the external processing server when they arrive. Depending on how the upstream system is implemented, request body chunks may be delivered before or after the response headers, and request and response body chunks may be interleaved if the upstream system delivers them that way. An external processor should be carefully coded so that it does not assume that a particular ordering will be implemented.