diff --git a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/api/PortUnificationServer.java b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/api/PortUnificationServer.java index 0276af933ca..0635946e756 100644 --- a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/api/PortUnificationServer.java +++ b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/api/PortUnificationServer.java @@ -165,15 +165,17 @@ public void operationComplete(final Future future) throws Exception { } System.out.println("shut operationComplete.."); long now = System.currentTimeMillis(); - while (now - start > 15000 || channelGroup.size() > 0) { + while (now - start <= 15000 || channelGroup.size() > 0) { try { Thread.sleep(100); } catch (InterruptedException e) { } } } - }).await(); + }).await(15000); + System.out.println("close cost:" + (System.currentTimeMillis()-start)); } catch (InterruptedException e) { + System.out.println("Interrupted while shutting down" + e.getMessage()); logger.warn("Interrupted while shutting down", e); } diff --git a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/GracefulShutdown.java b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/GracefulShutdown.java index 6b2d3c8fba2..4a8ac53605e 100644 --- a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/GracefulShutdown.java +++ b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/GracefulShutdown.java @@ -56,7 +56,7 @@ void secondGoAwayAndClose(ChannelHandlerContext ctx) { ctx.write(goAwayFrame); ctx.flush(); //gracefulShutdownTimeoutMillis - ctx.close(); + //ctx.close(); } catch (Exception e) { ctx.fireExceptionCaught(e); }