Skip to content
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

http: minor code clean up to the http filter manager #36027

Merged
merged 3 commits into from
Sep 9, 2024

Conversation

wbpcode
Copy link
Member

@wbpcode wbpcode commented Sep 8, 2024

Commit Message: http: minor code clean up to the http filter manager
Additional Description:

  1. simplify the code and remove unnecessary flag.
  2. resolve clang tidy warning.

Risk Level: low.
Testing: n/a.
Docs Changes: n/a.
Release Notes: n/a.
Platform Specific Features: n/a.

Signed-off-by: wangbaiping <wbphub@gmail.com>
Signed-off-by: wangbaiping <wbphub@gmail.com>
@wbpcode
Copy link
Member Author

wbpcode commented Sep 8, 2024

/assign-from @envoyproxy/senior-maintainers

Copy link

@envoyproxy/senior-maintainers assignee is @ggreenway

🐱

Caused by: a #36027 (comment) was created by @wbpcode.

see: more, trace.

Signed-off-by: wangbaiping <wbphub@gmail.com>
Copy link
Contributor

@ggreenway ggreenway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate on the reasoning for this change? My understanding is that this will make some of the callbacks be called twice now for filters that are both an encoder and decoder. Was that protection unnecessary?

/wait-any

@wbpcode
Copy link
Member Author

wbpcode commented Sep 9, 2024

My understanding is that this will make some of the callbacks be called twice now for filters that are both an encoder and decoder. Was that protection unnecessary?

Long time ago, we only have decoder_filters_ and encoder_filters, this protection is necessary. But at #15172, we introduce a new containers to store the StreamFilterBase pointer for every unique filter. We can iterate the that container directly and needn't any additional branch.

Can you elaborate on the reasoning for this change?

I want to optimize the implementation of filter manager and reduce the scattered memory allocations of http filter chain creation. And this is a minor pre-PR to simplify that optimization PR.

Copy link
Contributor

@ggreenway ggreenway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it; makes sense now.

@ggreenway ggreenway merged commit c57ddb6 into envoyproxy:main Sep 9, 2024
39 of 40 checks passed
@wbpcode wbpcode deleted the dev-minor-opt-fm branch September 9, 2024 22:51
unicell added a commit to unicell/envoy that referenced this pull request Sep 11, 2024
* upstream/main: (21 commits)
  Add a CPU utilization resource monitor for overload manager (envoyproxy#34713)
  jwks: Add UA string to headers (envoyproxy#35977)
  exceptions: cleaning up macros (envoyproxy#35694)
  coverage: ratcheting (envoyproxy#36058)
  runtime: load rtds bool correctly as true/false instead of 1/0 (envoyproxy#36044)
  Typo in documentation of http original_src filter (envoyproxy#36060)
  docs: updating meeting info (envoyproxy#36052)
  quic: removes more references to spdy::Http2HeaderBlock. (envoyproxy#36057)
  json: add null support to the streamer (envoyproxy#36051)
  json: make the streamer a template class (envoyproxy#36001)
  docs: Add `apt.envoyproxy.io` install information (envoyproxy#36050)
  ext_proc: elide redundant copy in ext_proc filter factory callback (envoyproxy#36015)
  build(deps): bump yarl from 1.11.0 to 1.11.1 in /tools/base (envoyproxy#36049)
  build(deps): bump multidict from 6.0.5 to 6.1.0 in /tools/base (envoyproxy#36048)
  quic: enable certificate compression/decompression (envoyproxy#35999)
  Geoip fix asan failure (envoyproxy#36043)
  mobile: Fix missing logging output in Swift integration tests (envoyproxy#36040)
  http: minor code clean up to the http filter manager (envoyproxy#36027)
  ci/example: Dont build/test the filter example in Envoy CI (envoyproxy#36038)
  ci/codeql: Fix build setup (envoyproxy#36021)
  ...

Signed-off-by: Qiu Yu <qiuyu@apple.com>
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.

2 participants