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.
@@ -46,7 +46,10 @@ public interface ChannelConnectionFactory extends ConnectionFactory {
@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) {
