Skip to content

Commit

Permalink
Remote: Use shutdownNow() instead of shutdown() in ChannelConnection#…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
coeuvre authored and copybara-github committed Apr 9, 2021
1 parent 627c16e commit f6e1074
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ public <ReqT, RespT> ClientCall<ReqT, RespT> call(

@Override
public void close() throws IOException {
channel.shutdown();
// 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.
channel.shutdownNow();
try {
channel.awaitTermination(Integer.MAX_VALUE, SECONDS);
} catch (InterruptedException e) {
Expand Down

0 comments on commit f6e1074

Please sign in to comment.