Skip to content

Commit

Permalink
add questions on handling multiple filter chains
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiitk committed Feb 6, 2025
1 parent 0705b6d commit 3c0d7e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions xds/src/main/java/io/grpc/xds/XdsServerWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public void uncaughtException(Thread t, Throwable e) {
private volatile Server delegate;

// Must be updated in the sync context.
// TODO(sergiitk): [QUESTION] should this be per filter chain too?
private final HashMap<String, Filter> activeFilters = new HashMap<>();

XdsServerWrapper(
Expand Down Expand Up @@ -464,6 +465,7 @@ private void shutdown() {
private void updateSelector() {
Map<FilterChain, AtomicReference<ServerRoutingConfig>> filterChainRouting = new HashMap<>();
savedRdsRoutingConfigRef.clear();
// TODO(sergiitk): [QUESTION] is filter names unique across all chains?
for (FilterChain filterChain: filterChains) {
filterChainRouting.put(filterChain, generateRoutingConfig(filterChain));
}
Expand Down Expand Up @@ -499,6 +501,7 @@ private AtomicReference<ServerRoutingConfig> generateRoutingConfig(FilterChain f
serverRoutingConfigRef.set(serverRoutingConfig);
} else {
serverRoutingConfigRef.set(ServerRoutingConfig.FAILING_ROUTING_CONFIG);
// TODO(sergiitk): [QUESTION] do we need to shutdown all filters here?
}
savedRdsRoutingConfigRef.put(filterChain, serverRoutingConfigRef);
return serverRoutingConfigRef;
Expand Down Expand Up @@ -725,6 +728,7 @@ private void updateRdsRoutingConfig() {
if (savedVirtualHosts == null) {
updatedRoutingConfig = ServerRoutingConfig.FAILING_ROUTING_CONFIG;
} else {
// TODO(sergiitk): [QUESTION] same applies here: should filters be per chain?
ImmutableMap<Route, ServerInterceptor> updatedInterceptors =
generatePerRouteInterceptors(
filterChain.httpConnectionManager().httpFilterConfigs(),
Expand Down

0 comments on commit 3c0d7e7

Please sign in to comment.