You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by "Ivan Kelly (JIRA)" <ji...@apache.org> on 2013/02/13 16:49:34 UTC
[jira] [Closed] (BOOKKEEPER-436) Journal#rollLog may leak file
handler
[ https://issues.apache.org/jira/browse/BOOKKEEPER-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ivan Kelly closed BOOKKEEPER-436.
---------------------------------
> 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