From ad3b98418b6739d14003753f913a894dc0868fc1 Mon Sep 17 00:00:00 2001 From: Michael Han Date: Fri, 24 Mar 2017 10:49:09 -0700 Subject: [PATCH] ZOOKEEPER-2737: close netty connection when exceptions occur during write to channel. To prevent resource leak. --- .../org/apache/zookeeper/server/NettyServerCnxnFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/java/main/org/apache/zookeeper/server/NettyServerCnxnFactory.java b/src/java/main/org/apache/zookeeper/server/NettyServerCnxnFactory.java index 25b682b8633..a02468953a5 100644 --- a/src/java/main/org/apache/zookeeper/server/NettyServerCnxnFactory.java +++ b/src/java/main/org/apache/zookeeper/server/NettyServerCnxnFactory.java @@ -144,8 +144,8 @@ public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) if (cnxn != null) { if (LOG.isDebugEnabled()) { LOG.debug("Closing " + cnxn); - cnxn.close(); } + cnxn.close(); } }