Skip to content

Commit f6e1074

Browse files
coeuvrecopybara-github
authored andcommitted
Remote: Use shutdownNow() instead of shutdown() in ChannelConnection#close() as a workaround to a gRPC bug.
There is a bug (b/183340374) in gRPC that client doesn't try to close connections with shutdown() if the channel received GO_AWAY frames. Using shutdownNow() here as a workaround. PiperOrigin-RevId: 367552792
1 parent 627c16e commit f6e1074

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/com/google/devtools/build/lib/remote/grpc/ChannelConnectionFactory.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ public <ReqT, RespT> ClientCall<ReqT, RespT> call(
4646

4747
@Override
4848
public void close() throws IOException {
49-
channel.shutdown();
49+
// There is a bug (b/183340374) in gRPC that client doesn't try to close connections with
50+
// shutdown() if the channel received GO_AWAY frames. Using shutdownNow() here as a
51+
// workaround.
52+
channel.shutdownNow();
5053
try {
5154
channel.awaitTermination(Integer.MAX_VALUE, SECONDS);
5255
} catch (InterruptedException e) {

0 commit comments

Comments
 (0)