yandrey321 commented on code in PR #1679:
URL: https://github.com/apache/ratis/pull/1679#discussion_r4464729293


##########
ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcServerProtocolClient.java:
##########
@@ -109,7 +129,8 @@ public void close() {
     if (useSeparateHBChannel) {
       GrpcUtil.shutdownManagedChannel(hbChannel);
     }
-    GrpcUtil.shutdownManagedChannel(channel);
+    // the first one is the main channel
+    appendEntriesChannels.forEach(GrpcUtil::shutdownManagedChannel);

Review Comment:
   Done. The new `GrpcUtil.shutdownManagedChannels(Collection)` calls 
`shutdown()` on every channel first, and only then awaits them, against one 
shared deadline. The same goes for `shutdownNow()` on the channels that haven't 
terminated.
   So closing a peer now waits at most one graceful and one forceful timeout in 
total, not one of each per channel.
   
   `close()` passes it the appendEntries channels (the first is the main 
channel) and the heartbeat channel. The existing single-channel 
`shutdownManagedChannel` is unchanged, and so are its timeouts and log messages.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to