diff --git a/interop-testing/src/main/java/io/grpc/testing/integration/AbstractInteropTest.java b/interop-testing/src/main/java/io/grpc/testing/integration/AbstractInteropTest.java index 11fe9832fd9..3f2aa048dec 100644 --- a/interop-testing/src/main/java/io/grpc/testing/integration/AbstractInteropTest.java +++ b/interop-testing/src/main/java/io/grpc/testing/integration/AbstractInteropTest.java @@ -1874,14 +1874,15 @@ private void executeSoakTestInThread( } long earliestNextStartNs = System.nanoTime() + TimeUnit.MILLISECONDS.toNanos(minTimeMsBetweenRpcs); - + // recordClientCallInterceptor takes an AtomicReference. + AtomicReference> soakThreadClientCallCapture = new AtomicReference<>(); currentChannel = maybeCreateChannel.apply(currentChannel); TestServiceGrpc.TestServiceBlockingStub currentStub = TestServiceGrpc .newBlockingStub(currentChannel) - .withInterceptors(recordClientCallInterceptor(clientCallCapture)); + .withInterceptors(recordClientCallInterceptor(soakThreadClientCallCapture)); SoakIterationResult result = performOneSoakIteration(currentStub, soakRequestSize, soakResponseSize); - SocketAddress peer = clientCallCapture + SocketAddress peer = soakThreadClientCallCapture .get().getAttributes().get(Grpc.TRANSPORT_ATTR_REMOTE_ADDR); StringBuilder logStr = new StringBuilder( String.format(