-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
Title: close the side gRPC stream once Envoy identify the external processing is completed
Description:
Currently Envoy keeps the side stream open until the ext_proc filter is destroyed. This wastes Envoy resource and the ext_proc server resource. The goal is to close the side gRPC stream once Envoy identify the external processing is completed. BTW, there are some discussions about this in partially discussed in #37088.
Approach:
After Envoy received and processed the ProcessingResponse from the ext_proc server, Envoy checks whether the external processing is done. If it is then close the side stream (may or may not go through graceful close depending the runtime flag).
Multiple phases:
It will take multiple PRs to complete this optimization.
The initial goal is to close the side stream in the obvious cases, like in cases:
- Envoy is configured to send request headers only,
- Client request is a header only request, and no encoding external processing
- This is the last body chunk with end-of-stream = true, and no future external processing needed.
There are other cases which are documented in below. These will be done in follow up PRs.
- ext_proc: closing the gRPC stream ASAP once no more external processing needed #41425 (comment)
- ext_proc: closing the gRPC stream ASAP once no more external processing needed #41425 (comment)
- or other miscellalious edge cases
[optional Relevant Links:]
Any extra documentation required to understand the issue.