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

Hudson commented on ZOOKEEPER-1753:
-----------------------------------

SUCCESS: Integrated in ZooKeeper-trunk #2060 (See 
[https://builds.apache.org/job/ZooKeeper-trunk/2060/])
ZOOKEEPER-1753. ClientCnxn is not properly releasing the resources, which are 
used to ping RwServer (Rakesh R via fpj) (fpj: 
http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1524398)
* /zookeeper/trunk/CHANGES.txt
* /zookeeper/trunk/src/java/main/org/apache/zookeeper/ClientCnxn.java

                
> ClientCnxn is not properly releasing the resources, which are used to ping 
> RwServer
> -----------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1753
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1753
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: java client
>            Reporter: Rakesh R
>            Assignee: Rakesh R
>             Fix For: 3.5.0, 3.4.6
>
>         Attachments: 0001-ZOOKEEPER-1753-fix-branch-3_4.patch, 
> 0001-ZOOKEEPER-1753.patch, 0002-ZOOKEEPER-1753.patch
>
>
> While pinging to the RwServer, ClientCnxn is opening a socket and using 
> BufferedReader. These are not properly closed in finally block and could 
> cause leaks on exceptional cases.
> ClientCnxn#pingRwServer()
> {code}
>             try {
>                 Socket sock = new Socket(addr.getHostName(), addr.getPort());
>                 BufferedReader br = new BufferedReader(
>                         new InputStreamReader(sock.getInputStream()));
>                 ......
>                 sock.close();
>                 br.close();
>             } catch (ConnectException e) {
>                 // ignore, this just means server is not up
>             } catch (IOException e) {
>                 // some unexpected error, warn about it
>                 LOG.warn("Exception while seeking for r/w server " +
>                         e.getMessage(), e);
>             }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to