Skip to content

Commit 234852b

Browse files
committed
Add ExtProcClientInterceptor as the last in chain since it erases the type information for downstream interceptors
1 parent 565f5c9 commit 234852b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,7 @@ private ClientInterceptor createFilters(
817817
}
818818

819819
ImmutableList.Builder<ClientInterceptor> filterInterceptors = ImmutableList.builder();
820+
ClientInterceptor extProcInterceptor = null;
820821
for (NamedFilterConfig namedFilter : filterConfigs) {
821822
String name = namedFilter.name;
822823
FilterConfig config = namedFilter.filterConfig;
@@ -829,10 +830,18 @@ private ClientInterceptor createFilters(
829830
filter.buildClientInterceptor(config, overrideConfig, scheduler);
830831

831832
if (interceptor != null) {
832-
filterInterceptors.add(interceptor);
833+
if (config.typeUrl().equals(ExternalProcessorFilter.TYPE_URL)) {
834+
extProcInterceptor = interceptor;
835+
} else {
836+
filterInterceptors.add(interceptor);
837+
}
833838
}
834839
}
835840

841+
if (extProcInterceptor != null) {
842+
filterInterceptors.add(extProcInterceptor);
843+
}
844+
836845
// Combine interceptors produced by different filters into a single one that executes
837846
// them sequentially. The order is preserved.
838847
return combineInterceptors(filterInterceptors.build());

0 commit comments

Comments
 (0)