Skip to content

Commit d008b3f

Browse files
ludochgae-java-bot
authored andcommitted
Fix ThreadSanitizer issues in App Engine runtime tests.
PiperOrigin-RevId: 888863426 Change-Id: Ib3f59c527b9e2a34ae6b78eff52139e3242f5260
1 parent 16947a1 commit d008b3f

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

runtime/runtime_impl_jetty121/src/test/java/com/google/apphosting/runtime/grpc/FakeApiProxyImplFactory.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import com.google.apphosting.runtime.timer.TimerFactory;
2929
import java.time.Duration;
3030
import java.util.ArrayList;
31+
import java.util.Collections;
3132
import java.util.List;
3233
import java.util.concurrent.Future;
3334
import java.util.concurrent.Semaphore;
@@ -68,7 +69,7 @@ public static ApiProxyImpl.EnvironmentImpl fakeEnvironment(
6869
public static ApiProxyImpl.EnvironmentImpl fakeEnvironment(
6970
ApiProxyImpl apiProxyImpl, String securityTicket, TraceWriter traceWriter) {
7071
Semaphore outstandingApiRpcSemaphore = new Semaphore(1);
71-
List<Future<?>> asyncFutures = new ArrayList<>();
72+
List<Future<?>> asyncFutures = Collections.synchronizedList(new ArrayList<>());
7273
RuntimePb.UPRequest request =
7374
RuntimePb.UPRequest.newBuilder().setSecurityTicket(securityTicket).buildPartial();
7475
return apiProxyImpl.createEnvironment(
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Suppress known ThreadSanitizer data race in Jetty's SelectableChannelEndPoint
2+
# This is caused by logging the endpoint string concurrently with updateKey().
3+
race:org.eclipse.jetty.io.SelectableChannelEndPoint
4+
race:org.eclipse.jetty.io.ChannelEndPoint
5+
race:org.eclipse.jetty.server.AbstractConnector

runtime/runtime_impl_jetty9/src/test/java/com/google/apphosting/runtime/grpc/FakeApiProxyImplFactory.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import com.google.apphosting.runtime.timer.TimerFactory;
2929
import java.time.Duration;
3030
import java.util.ArrayList;
31+
import java.util.Collections;
3132
import java.util.List;
3233
import java.util.concurrent.Future;
3334
import java.util.concurrent.Semaphore;
@@ -68,7 +69,7 @@ public static ApiProxyImpl.EnvironmentImpl fakeEnvironment(
6869
public static ApiProxyImpl.EnvironmentImpl fakeEnvironment(
6970
ApiProxyImpl apiProxyImpl, String securityTicket, TraceWriter traceWriter) {
7071
Semaphore outstandingApiRpcSemaphore = new Semaphore(1);
71-
List<Future<?>> asyncFutures = new ArrayList<>();
72+
List<Future<?>> asyncFutures = Collections.synchronizedList(new ArrayList<>());
7273
RuntimePb.UPRequest request =
7374
RuntimePb.UPRequest.newBuilder().setSecurityTicket(securityTicket).buildPartial();
7475
return apiProxyImpl.createEnvironment(
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Suppress known ThreadSanitizer data race in Jetty's SelectableChannelEndPoint
2+
# This is caused by logging the endpoint string concurrently with updateKey().
3+
race:org.eclipse.jetty.io.SelectableChannelEndPoint
4+
race:org.eclipse.jetty.io.ChannelEndPoint
5+
race:org.eclipse.jetty.server.AbstractConnector

0 commit comments

Comments
 (0)