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 philwo committed Apr 20, 2021
1 parent b5b391c commit ee7a421
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 ee7a421

Please sign in to comment.