Skip to content

Commit 9b3306d

Browse files
committed
add questions on handling multiple filter chains
1 parent 0705b6d commit 9b3306d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

xds/src/main/java/io/grpc/xds/XdsServerWrapper.java

+4
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ public void uncaughtException(Thread t, Throwable e) {
116116
private volatile Server delegate;
117117

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

121122
XdsServerWrapper(
@@ -464,6 +465,7 @@ private void shutdown() {
464465
private void updateSelector() {
465466
Map<FilterChain, AtomicReference<ServerRoutingConfig>> filterChainRouting = new HashMap<>();
466467
savedRdsRoutingConfigRef.clear();
468+
// TODO(sergiitk): [QUESTION] is filter names unique across all chains?
467469
for (FilterChain filterChain: filterChains) {
468470
filterChainRouting.put(filterChain, generateRoutingConfig(filterChain));
469471
}
@@ -499,6 +501,7 @@ private AtomicReference<ServerRoutingConfig> generateRoutingConfig(FilterChain f
499501
serverRoutingConfigRef.set(serverRoutingConfig);
500502
} else {
501503
serverRoutingConfigRef.set(ServerRoutingConfig.FAILING_ROUTING_CONFIG);
504+
// TODO(sergiitk): [QUESTION] do we need to shutdown all filters here?
502505
}
503506
savedRdsRoutingConfigRef.put(filterChain, serverRoutingConfigRef);
504507
return serverRoutingConfigRef;
@@ -725,6 +728,7 @@ private void updateRdsRoutingConfig() {
725728
if (savedVirtualHosts == null) {
726729
updatedRoutingConfig = ServerRoutingConfig.FAILING_ROUTING_CONFIG;
727730
} else {
731+
// TODO(sergiitk): [QUESTION] same applies here: should filters be per chain?
728732
ImmutableMap<Route, ServerInterceptor> updatedInterceptors =
729733
generatePerRouteInterceptors(
730734
filterChain.httpConnectionManager().httpFilterConfigs(),

0 commit comments

Comments
 (0)