Skip to content

Commit b6e22cb

Browse files
committed
xds: Add Category 20 tests for client interceptor concurrency and serialization
Introduce a new Category 20 test suite to verify the concurrency and serialization behaviors of the `ExternalProcessorClientInterceptor`. - Implement `clientInterceptor_concurrency_serializesDelegateCallbacks` to verify serialization of data-plane delegate callbacks during high-concurrency message flows. - Implement `clientInterceptor_outboundStreamTermination_serializesSendMessage` to verify serialization of messages sent concurrently with outbound stream termination. - Implement `clientInterceptor_concurrentStartAndFailOpen_startsCallCorrectly` to verify safe concurrent start and fail-open sequence handling. - Add Category 20 grouping comment header in the test file.
1 parent c67d95b commit b6e22cb

3 files changed

Lines changed: 3016 additions & 2513 deletions

File tree

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

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -892,14 +892,12 @@ private ClientInterceptor createFilters(
892892
}
893893

894894
ImmutableList.Builder<ClientInterceptor> filterInterceptors = ImmutableList.builder();
895-
boolean hasExtProc = false;
896895
for (NamedFilterConfig namedFilter : filterConfigs) {
897896
String typeUrl = namedFilter.filterConfig.typeUrl();
898897
if (typeUrl.equals(ExternalProcessorFilter.TYPE_URL)) {
899898
if (!GrpcUtil.getFlag("GRPC_EXPERIMENTAL_XDS_EXT_PROC_ON_CLIENT", false)) {
900899
continue;
901900
}
902-
hasExtProc = true;
903901
}
904902
String name = namedFilter.name;
905903
FilterConfig config = namedFilter.filterConfig;
@@ -916,16 +914,10 @@ private ClientInterceptor createFilters(
916914
}
917915
}
918916

919-
if (hasExtProc) {
920-
ImmutableList.Builder<ClientInterceptor> withRawMessage = ImmutableList.builder();
921-
withRawMessage.add(new RawMessageClientInterceptor());
922-
withRawMessage.addAll(filterInterceptors.build());
923-
return combineInterceptors(withRawMessage.build());
924-
}
925-
926-
// Combine interceptors produced by different filters into a single one that executes
927-
// them sequentially. The order is preserved.
928-
return combineInterceptors(filterInterceptors.build());
917+
ImmutableList.Builder<ClientInterceptor> withRawMessage = ImmutableList.builder();
918+
withRawMessage.add(new RawMessageClientInterceptor());
919+
withRawMessage.addAll(filterInterceptors.build());
920+
return combineInterceptors(withRawMessage.build());
929921
}
930922

931923
private void cleanUpRoutes(Status error) {

0 commit comments

Comments
 (0)