Uma Maheswara Rao G created BOOKKEEPER-436:
----------------------------------------------

             Summary: Journal#rollLog may leak file handler
                 Key: BOOKKEEPER-436
                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-436
             Project: Bookkeeper
          Issue Type: Bug
    Affects Versions: 4.2.0
            Reporter: Uma Maheswara Rao G
            Priority: Minor


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

Reply via email to