http: add upstream-request watermark callbacks to HCM#46020
Merged
botengyao merged 3 commits intoJul 7, 2026
Conversation
Introduce UpstreamWatermarkCallbacks (envoy/http/codec.h) and the
add/removeUpstreamWatermarkCallbacks subscription API on
StreamDecoderFilterCallbacks (envoy/http/filter.h), implemented by the
FilterManager and fanned out from the connection manager's
onDecoderFilter{Above,Below}WriteBuffer{High,Low}Watermark hooks.
The downstream codec read-disable only slows the original request source.
A filter that produces request data of its own (e.g. by replaying a
buffered body via injectDecodedDataToFilterChain) does not see that
back-pressure, so it needs to subscribe here to pause/resume in step with
the upstream. A mid-stream subscriber is brought up to the current
back-pressure state on registration.
Adds stub overrides in the async client and tcp_proxy StreamDecoder
FilterCallbacks implementations, a mock, and connection-manager coverage.
Signed-off-by: Peng Gao <pengg@google.com>
Contributor
Author
|
/assign @wbpcode @botengyao |
Contributor
Author
|
/cc @yanjunxiang-google / @markdroth you'll likely need this for ext_proc flow control |
Merge main changes. Signed-off-by: Peng Gao <pengg@google.com>
Contributor
Author
|
fixing pre-existing format in #46022 |
Merge format fix. Signed-off-by: Peng Gao <pengg@google.com>
botengyao
approved these changes
Jul 7, 2026
Contributor
Author
|
/retest |
Member
|
Nice! |
Member
|
/retest |
Contributor
|
LGTM! Thanks for working on this! |
This was referenced Jul 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit Message:
Introduce UpstreamWatermarkCallbacks (envoy/http/codec.h) and the (add|remove)UpstreamWatermarkCallbacks subscription API on StreamDecoderFilterCallbacks (envoy/http/filter.h), implemented by the FilterManager and fanned out from the connection manager's onDecoderFilter{Above,Below}WriteBuffer{High,Low}Watermark hooks.
Useful when a filter uses injectDecodedDataToFilterChain and wants to avoid overrunning the upstream buffer. This is a spawn-off of #45899 as per review.
Also adds stub overrides in the async client and tcp_proxy StreamDecoder FilterCallbacks implementations, a mock, and connection-manager coverage.
This change is a spawn-off of #45899, which I used AI to generate. I have read and understand the code.
Additional Description:
Risk Level: Medium - new callbacks to HCM, but not yet used
Testing: unit tests
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]