You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Camille Fournier (JIRA)" <ji...@apache.org> on 2011/09/08 20:58:10 UTC
[jira] [Commented] (ZOOKEEPER-1174) FD leak when network
unreachable
[ https://issues.apache.org/jira/browse/ZOOKEEPER-1174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13100583#comment-13100583 ]
Camille Fournier commented on ZOOKEEPER-1174:
---------------------------------------------
We'd have to change drastically the try/catch logic to try to connect the socket then register it with the selector.
Should we just fix this by calling selector.selectNow() in the cleanup method after cancelling the sockKey? I think that might fix the leak.
> FD leak when network unreachable
> --------------------------------
>
> Key: ZOOKEEPER-1174
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1174
> Project: ZooKeeper
> Issue Type: Bug
> Components: java client
> Affects Versions: 3.3.3
> Reporter: Ted Dunning
> Assignee: Ted Dunning
> Priority: Critical
> Fix For: 3.3.4
>
>
> In the socket connection logic there are several errors that result in bad behavior. The basic problem is that a socket is registered with a selector unconditionally when there are nuances that should be dealt with. First, the socket may connect immediately. Secondly, the connect may throw an exception. In either of these two cases, I don't think that the socket should be registered.
> I will attach a test case that demonstrates the problem. I have been unable to create a unit test that exhibits the problem because I would have to mock the low level socket libraries to do so. It would still be good to do so if somebody can figure out a good way.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira