Skip to content

Conversation

@sergiitk
Copy link
Member

@sergiitk sergiitk commented Mar 3, 2025

This PR adds support filter state retention in Java. The mechanism will be similar to the one described in A83 for C-core, and will serve the same purpose. However, the implementation details are very different due to the different nature of xDS HTTP filter support in C-core and Java.

Filter instance lifecycle

xDS gRPC clients

New filter instances are created per combination of:

  1. XdsNameResolver instance,
  2. Filter name+typeUrl as configured in HttpConnectionManager (HCM) http_filters.

Existing client-side filter instances are shutdown:

  • A single filter instance -- when an LDS update contains HCM that is missing filter configuration for name+typeUrl combination of this instance.
  • All filter instances -- when watched LDS resource is missing from an LDS update.
  • All filter instances -- on name resolver shutdown.

xDS-enabled gRPC servers

New filter instances are created per combination of:

  1. Server instance,
  2. FilterChain name,
  3. Filter name+typeUrl as configured in FilterChain's HCM.http_filters.

Filter instances of Default Filter Chain is tracked separately per:

  1. Server instance,
  2. Filter name+typeUrl in default_filter_chain's HCM.http_filters.

Existing server-side filter instances are shutdown:

  • A single filter instance -- when an LDS update contains FilterChain with HCM.http_filters that is missing configuration for filter name+typeUrl.
  • All filter instances associated with the FilterChain -- when an LDS update no longer contains FilterChain's name.
  • All filter instances -- when watched LDS resource is missing from an LDS update.
  • All filter instances -- on server shutdown.

Related

Introduces filter instance lifecycle.

**xDS gRPC clients**

New filter instances are created per combination of:
1. `XdsNameResolver` instance,
2. Filter name+typeUrl in HttpConnectionManager (HCM) http_filters.

Existing client-side filter instances are shutdown:
- A single a filter instance is shutdown when an LDS update contains
  HCM that is missing filter configuration for name+typeUrl
  combination of this instance.
- All filter instances when watched LDS resource is missing from
  an LDS update.
- All filter instances name resolver shutdown.

**xDS-enabled gRPC servers**

New filter instances are created per combination of:
1. Server instance,
2. FilterChain name,
3. Filter name+typeUrl in FilterChain's HCM.http_filters.

Filter instances of Default Filter Chain is tracked separately per:
1. Server instance,
2. Filter name+typeUrl in default_filter_chain's HCM.http_filters.

Existing server-side filter instances are shutdown:
- A single a filter instance is shutdown when an LDS update contains
  FilterChain with HCM.http_filters that is missing configuration for
  filter name+typeUrl.
- All filter instances associated with the FilterChain when an LDS
  update no longer contains FilterChain's name.
- All filter instances when watched LDS resource is missing from
  an LDS update.
- All filter instances on server shutdown.
@sergiitk sergiitk requested a review from ejona86 March 4, 2025 00:16
@sergiitk sergiitk marked this pull request as ready for review March 4, 2025 00:16
@sergiitk
Copy link
Member Author

sergiitk commented Mar 4, 2025

FYI @shivaspeaks @larry-safran

Copy link
Member

@ejona86 ejona86 left a comment

Choose a reason for hiding this comment

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

Sending what I have. I need to still read XdsServerWrapper, but I'm not expecting any problems.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Mar 6, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@sergiitk
Copy link
Member Author

sergiitk commented Mar 6, 2025

/easycla

Apparently "EasyCLA is broken at the moment; they are working on it"

@sergiitk
Copy link
Member Author

sergiitk commented Mar 6, 2025

/easycla

2 similar comments
@sergiitk
Copy link
Member Author

sergiitk commented Mar 6, 2025

/easycla

@sergiitk
Copy link
Member Author

sergiitk commented Mar 6, 2025

/easycla

@sergiitk sergiitk merged commit a6a041e into grpc:master Mar 6, 2025
16 checks passed
@sergiitk sergiitk deleted the xds-filter-state branch March 6, 2025 18:32
@sergiitk
Copy link
Member Author

sergiitk commented Mar 6, 2025

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants