zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hadoop QA (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ZOOKEEPER-2737) NettyServerCnxFactory leaks connection if exception happens while writing to a channel.
Date Fri, 24 Mar 2017 18:14:41 GMT

    [ https://issues.apache.org/jira/browse/ZOOKEEPER-2737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15940852#comment-15940852
] 

Hadoop QA commented on ZOOKEEPER-2737:
--------------------------------------

+1 overall.  GitHub Pull Request  Build
      

    +1 @author.  The patch does not contain any @author tags.

    +0 tests included.  The patch appears to be a documentation patch that doesn't require
tests.

    +1 javadoc.  The javadoc tool did not generate any warning messages.

    +1 javac.  The applied patch does not increase the total number of javac compiler warnings.

    +1 findbugs.  The patch does not introduce any new Findbugs (version 3.0.1) warnings.

    +1 release audit.  The applied patch does not increase the total number of release audit
warnings.

    +1 core tests.  The patch passed core unit tests.

    +1 contrib tests.  The patch passed contrib unit tests.

Test results: https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/478//testReport/
Findbugs warnings: https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/478//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/478//console

This message is automatically generated.

> NettyServerCnxFactory leaks connection if exception happens while writing to a channel.
> ---------------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-2737
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2737
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.5.2
>            Reporter: Michael Han
>            Assignee: Michael Han
>            Priority: Critical
>              Labels: connection, netty, server
>
> Found this while debugging occasionally failed unit tests. Currently we do this if exception
occurs during writing to a channel with Netty:
> {code}
> @Override
>         public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)
>             throws Exception
>         {
>             LOG.warn("Exception caught " + e, e.getCause());
>             NettyServerCnxn cnxn = (NettyServerCnxn) ctx.getAttachment();
>             if (cnxn != null) {
>                 if (LOG.isDebugEnabled()) {
>                     LOG.debug("Closing " + cnxn);
>                     cnxn.close();
>                 }
>             }
>         }
> {code}
> So the connection is only closed when debug mode is enabled. This is problematic as lots
of clean up code is abstracted inside the close and without proper close the connection we
are leaking resources.
> [Commit log|https://github.com/apache/zookeeper/blob/master/src/java/main/org/apache/zookeeper/server/NettyServerCnxnFactory.java#L147]
indicates the issue exists since day 1 with ZOOKEEPER-733. Note the original patch uploaded
to ZOOKEEPER-733 has this close call in right place, and the call gets moved around during
iteration of the patches w/o gets noticed.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message