mirror of https://github.com/grpc/grpc-java.git
interop-testing: fix race in CascadingTest
ServerCall.close() is meant to only be accessed from a single thread, but in the test it is accessed from the callbacks of several client calls. Synchronize access to sate TSAN.
This commit is contained in:
parent
855740622a
commit
c3d7d74175
|
|
@ -295,7 +295,9 @@ public class CascadingTest {
|
|||
Context.currentContextExecutor(otherWork).execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
call.close(Status.ABORTED, new Metadata());
|
||||
synchronized (call) {
|
||||
call.close(Status.ABORTED, new Metadata());
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (req.getResponseSize() != 0) {
|
||||
|
|
@ -316,7 +318,9 @@ public class CascadingTest {
|
|||
}
|
||||
// Propagate closure upwards.
|
||||
try {
|
||||
call.close(status, new Metadata());
|
||||
synchronized (call) {
|
||||
call.close(status, new Metadata());
|
||||
}
|
||||
} catch (IllegalStateException t2) {
|
||||
// Ignore error if already closed.
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue