You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by "Hudson (JIRA)" <ji...@apache.org> on 2012/10/17 12:24:03 UTC

[jira] [Commented] (BOOKKEEPER-436) Journal#rollLog may leak file handler

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

Hudson commented on BOOKKEEPER-436:
-----------------------------------

Integrated in bookkeeper-trunk #756 (See [https://builds.apache.org/job/bookkeeper-trunk/756/])
    BOOKKEEPER-436: Journal#rollLog may leak file handler (umamahesh via ivank) (Revision 1398995)

     Result = FAILURE
ivank : 
Files : 
* /zookeeper/bookkeeper/trunk/CHANGES.txt
* /zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Journal.java

                
> Journal#rollLog may leak file handler
> -------------------------------------
>
>                 Key: BOOKKEEPER-436
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-436
>             Project: Bookkeeper
>          Issue Type: Bug
>            Reporter: Uma Maheswara Rao G
>            Assignee: Uma Maheswara Rao G
>            Priority: Minor
>             Fix For: 4.2.0
>
>         Attachments: BOOKKEEPER-436.patch
>
>
> Just seen the peice of code in Jouranl#rollLog 
> {code}
> try {
>                     FileOutputStream fos = new FileOutputStream(file);
>                     fos.write(buff);
>                     fos.getChannel().force(true);
>                     fos.close();
>                 } catch (IOException e) {
>                     LOG.error("Problems writing to " + file, e);
>                 }
> {code}
> On exception It is just logging and continuing.
> Even though FileOutputStream provides finalize implementation and which will clean streams, I don't think it's a good idea to depend on it as it will not be garanteed.
> cleaning with more care would avoid this.

--
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