[ https://issues.apache.org/jira/browse/HBASE-6002?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13278010#comment-13278010 ]
Chinna Rao Lalam commented on HBASE-6002: ----------------------------------------- @Ted: If add closed flag in WriterAndPath after successfull close of the writer make this flag to true. so first time if it fails flag wont be true and second time it will try to close. I feel same thing is achieved with the writer!=null in SequenceFileLogWriter.close(). Here after successful close of the writer it will be initialized with null. So second time if tries to close the already closed writer it will check whether it is null or not if not equal to null then only it will try to close. {code} if (this.writer != null) { try { this.writer.close(); } catch (NullPointerException npe) { // Can get a NPE coming up from down in DFSClient$DFSOutputStream#close LOG.warn(npe); } this.writer = null; } {code} your comment @ 16/May/12 18:44 bq.If the first close encountered some IOE, calling it the second time would most likely encounter similar error. if the first close encountered IOE if we have closed flag in WriterAndPath it wont be make it true because writer is not succesfully closed. So second time it will try to close. We can use this flag as attempted or not? If my understanding is wrong pls correct me. > Possible chance of resource leak in HlogSplitter > ------------------------------------------------ > > Key: HBASE-6002 > URL: https://issues.apache.org/jira/browse/HBASE-6002 > Project: HBase > Issue Type: Bug > Components: wal > Affects Versions: 0.94.0, 0.96.0 > Reporter: Chinna Rao Lalam > Assignee: Chinna Rao Lalam > Attachments: HBASE-6002.patch, HBASE-6002_0.94_1.patch, > HBASE-6002_trunk.patch > > > In HLogSplitter.splitLogFileToTemp-Reader(in) is not closed and in finally > block in loop while closing the writers(wap.w) if any exception comes other > writers won't close. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira