Repository: zookeeper
Updated Branches:
  refs/heads/master 54c7f6b47 -> d8adc547f


ZOOKEEPER-2737: close netty connection when exceptions occur during w…

…rite to channel to prevent resource leak.

I am OK to add some contrived test case to test this but I'd like to do that 
later if needed, so this fix can get in upcoming releases..

Author: Michael Han <[email protected]>

Reviewers: Brian Nixon <[email protected]>, Abraham Fine <[email protected]>, Rakesh 
Radhakrishnan <[email protected]>, Patrick Hunt <[email protected]>

Closes #207 from hanm/ZOOKEEPER-2737

(cherry picked from commit 5c356f5a47402c000b5e206a536273afc75de883)
Signed-off-by: Michael Han <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/zookeeper/repo
Commit: http://git-wip-us.apache.org/repos/asf/zookeeper/commit/d8adc547
Tree: http://git-wip-us.apache.org/repos/asf/zookeeper/tree/d8adc547
Diff: http://git-wip-us.apache.org/repos/asf/zookeeper/diff/d8adc547

Branch: refs/heads/master
Commit: d8adc547f9856747905b7d46450f13fa98df147f
Parents: 54c7f6b
Author: Michael Han <[email protected]>
Authored: Mon Mar 27 10:31:44 2017 -0700
Committer: Michael Han <[email protected]>
Committed: Mon Mar 27 10:32:02 2017 -0700

----------------------------------------------------------------------
 .../main/org/apache/zookeeper/server/NettyServerCnxnFactory.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zookeeper/blob/d8adc547/src/java/main/org/apache/zookeeper/server/NettyServerCnxnFactory.java
----------------------------------------------------------------------
diff --git 
a/src/java/main/org/apache/zookeeper/server/NettyServerCnxnFactory.java 
b/src/java/main/org/apache/zookeeper/server/NettyServerCnxnFactory.java
index 25b682b..a024689 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 class NettyServerCnxnFactory extends 
ServerCnxnFactory {
             if (cnxn != null) {
                 if (LOG.isDebugEnabled()) {
                     LOG.debug("Closing " + cnxn);
-                    cnxn.close();
                 }
+                cnxn.close();
             }
         }
 

Reply via email to