Skip to content

ai_protocol_manager: support upstream HTTP filter chains#46385

Draft
botengyao wants to merge 1 commit into
envoyproxy:mainfrom
botengyao:ai-protocol-manager-dual-filter
Draft

ai_protocol_manager: support upstream HTTP filter chains#46385
botengyao wants to merge 1 commit into
envoyproxy:mainfrom
botengyao:ai-protocol-manager-dual-filter

Conversation

@botengyao

Copy link
Copy Markdown
Member

Commit Message:
Register the AI Protocol Manager filter as a dual filter so it can run in a cluster's upstream HTTP filter chain as well as the downstream chain, and fan upstream-request back-pressure out to addUpstreamWatermarkCallbacks subscribers in the upstream filter manager (mirroring the connection manager's behavior from #46020) so the filter's replay stays paced when running upstream.

Additional Description:
Without the upstream_request.cc fan-out the subscriber list never fired in upstream chains, so replay of a large payload would buffer unboundedly in the upstream connection. Docs note the upstream caveats: no per-upgrade-type chain selection upstream, and upstream local replies bypass router retry/hedging arbitration.

This PR was generated with AI assistance. I have read and understand the code.

Risk Level: Medium — new watermark fan-out in UpstreamRequestFilterManagerCallbacks; dual registration is additive.
Testing: unit tests for the dual factory and the watermark fan-out; integration tests run every scenario with the filter in both chains across protocol combinations.
Docs Changes: ai_protocol_manager_filter.rst — upstream configuration pointer and caveats.
Release Notes: n/a (work-in-progress extension, consistent with #45899/#46020).
Platform Specific Features: n/a

Register the filter as a dual filter (DualFactoryBase) so it can run in a
cluster's upstream HTTP filter chain as well as the downstream chain. Also
fan upstream-request back-pressure out to addUpstreamWatermarkCallbacks
subscribers in the upstream filter manager, mirroring the connection
manager's behavior from envoyproxy#46020, so the filter's replay stays paced when it
runs upstream.

Signed-off-by: Boteng Yao <botengyao@gmail.com>
@repokitteh-read-only

Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #46385 was opened by botengyao.

see: more, trace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant