Commit 44075af
committed
xds: Fix concurrent StreamObserver usage in ExternalProcessorClientInterceptorTest
Synchronize calls to the gRPC StreamObserver (responseObserver) inside mock
ExternalProcessor implementations. The mock servers in several tests spawn background
threads to handle requests, but they invoke responseObserver.onNext(), onCompleted(),
and onError() concurrently without synchronization. Since standard StreamObservers
are not thread-safe, this leads to ThreadSanitizer-reported data races in gRPC
internals (such as ServerCallImpl).
This change wraps all asynchronous/background invocations of responseObserver
methods inside synchronized blocks on the observer instance to ensure serialized execution.1 parent 53ebe2d commit 44075af
1 file changed
Lines changed: 259 additions & 180 deletions
0 commit comments