You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zookeeper.apache.org by ha...@apache.org on 2017/07/20 17:40:13 UTC

zookeeper git commit: ZOOKEEPER-2740: close netty connection when exceptions occur during write to channel to prevent resource leak.

Repository: zookeeper
Updated Branches:
  refs/heads/branch-3.4 3872e49f6 -> f8b5be0af


ZOOKEEPER-2740: close netty connection when exceptions occur during write to channel to prevent resource leak.

This bug happily hides in code base for 7 years until it's revealed from a failed unit tests. This commit is cherry picked from ZOOKEEPER-2737 / 5c356f5a47402c000b5e206a536273afc75de883.

Author: Michael Han <ha...@apache.org>

Reviewers: Brian Nixon <ni...@fb.com>, Abraham Fine <af...@apache.org>, Rakesh Radhakrishnan <ra...@apache.org>, Patrick Hunt <ph...@apache.org>

Closes #207 from hanm/ZOOKEEPER-2737


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

Branch: refs/heads/branch-3.4
Commit: f8b5be0af45d2127b096ed41c11d3c0d7244df8e
Parents: 3872e49
Author: Michael Han <ha...@apache.org>
Authored: Mon Mar 27 10:31:44 2017 -0700
Committer: Michael Han <ha...@apache.org>
Committed: Thu Jul 20 10:26:57 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/f8b5be0a/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 2087eaa..2d3c93f 100644
--- a/src/java/main/org/apache/zookeeper/server/NettyServerCnxnFactory.java
+++ b/src/java/main/org/apache/zookeeper/server/NettyServerCnxnFactory.java
@@ -113,8 +113,8 @@ public class NettyServerCnxnFactory extends ServerCnxnFactory {
             if (cnxn != null) {
                 if (LOG.isDebugEnabled()) {
                     LOG.debug("Closing " + cnxn);
-                    cnxn.close();
                 }
+                cnxn.close();
             }
         }