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

Michi Mutsuzaki commented on ZOOKEEPER-2218:
--------------------------------------------

Thank you for the patch Tang! I have 2 comments:

- Please replace tabs with spaces.
- It's probably cleaner to use try-with-resources: 
https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html

> Close IO Streams in finally block
> ---------------------------------
>
>                 Key: ZOOKEEPER-2218
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2218
>             Project: ZooKeeper
>          Issue Type: Bug
>            Reporter: Tang Xinye
>            Assignee: Bill Havanki
>            Priority: Critical
>             Fix For: 3.5.2, 3.6.0
>
>         Attachments: ZOOKEEPER-2218.patch, ZOOKEEPER-2218.patch
>
>
> The problem here is that if an exception is thrown during the read process 
> the method will exit without closing the stream and hence without releasing 
> the file system resources, it may run out of resources before it does run.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to