amaliujia commented on a change in pull request #236:
URL: https://github.com/apache/incubator-ratis/pull/236#discussion_r513749758



##########
File path: 
ratis-netty/src/main/java/org/apache/ratis/netty/server/NettyServerStreamRpc.java
##########
@@ -310,26 +324,21 @@ protected void encode(ChannelHandlerContext context, 
DataStreamReplyByteBuffer r
     };
   }
 
-  private Channel getChannel() {
-    return channelFuture.awaitUninterruptibly().channel();
-  }
-
   @Override
   public void start() {
     channelFuture.syncUninterruptibly();
   }
 
   @Override
   public void close() {
-    final ChannelFuture f = getChannel().close();
-    f.syncUninterruptibly();
-    bossGroup.shutdownGracefully(0, 100, TimeUnit.MILLISECONDS);
-    workerGroup.shutdownGracefully(0, 100, TimeUnit.MILLISECONDS);
     try {
+      channelFuture.channel().close().sync();
+      bossGroup.shutdownGracefully(0, 100, TimeUnit.MILLISECONDS);
+      workerGroup.shutdownGracefully(0, 100, TimeUnit.MILLISECONDS);
       bossGroup.awaitTermination(1000, TimeUnit.MILLISECONDS);
       workerGroup.awaitTermination(1000, TimeUnit.MILLISECONDS);
     } catch (InterruptedException e) {
-      LOG.error("Interrupt EventLoopGroup terminate", e);
+      LOG.error(this + ": Interrupted close()", e);

Review comment:
       nit: `this + ".close() is Interrupted"`




----------------------------------------------------------------
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.

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


Reply via email to