mirror of https://github.com/grpc/grpc-java.git
Fix unsynchronized access in InProcessTransport
This commit is contained in:
parent
9cb79292aa
commit
5205d9cc43
|
|
@ -120,10 +120,11 @@ class InProcessTransport implements ServerTransport, ClientTransport {
|
||||||
public synchronized ClientStream newStream(
|
public synchronized ClientStream newStream(
|
||||||
final MethodDescriptor<?, ?> method, final Metadata headers) {
|
final MethodDescriptor<?, ?> method, final Metadata headers) {
|
||||||
if (shutdownStatus != null) {
|
if (shutdownStatus != null) {
|
||||||
|
final Status capturedStatus = shutdownStatus;
|
||||||
return new NoopClientStream() {
|
return new NoopClientStream() {
|
||||||
@Override
|
@Override
|
||||||
public void start(ClientStreamListener listener) {
|
public void start(ClientStreamListener listener) {
|
||||||
listener.closed(shutdownStatus, new Metadata());
|
listener.closed(capturedStatus, new Metadata());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue