[
https://issues.apache.org/jira/browse/BOOKKEEPER-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14679591#comment-14679591
]
Rakesh R commented on BOOKKEEPER-863:
-------------------------------------
Thanks [[email protected]] for the contribution. Just few suggestions:
# Please uninitialize factory. Also, good to catch exceptions in the finally
block like,
{code}
} finally {
try{
m.close();
mFactory.uninitialize();
} catch (IOException ioe) {
LOG.error("Failed to close ledger manager : ", ioe);
}
.......
.......
}
{code}
# Please close the {{ledgerManager#close();}} before {{zk#close();}}. IMHO,
this avoids unwanted ZooKeeper client exception in between closure.
> Potential resource leak with unclosed LedgerManager in BookieShell
> ------------------------------------------------------------------
>
> Key: BOOKKEEPER-863
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-863
> Project: Bookkeeper
> Issue Type: Bug
> Reporter: Ted Yu
> Assignee: Ted Yu
> Attachments: bookkeeper-863.patch
>
>
> There're more than one occurrence.
> Here is an example in ListLedgersCmd#runCmd():
> {code}
> LedgerManagerFactory mFactory =
> LedgerManagerFactory.newLedgerManagerFactory(bkConf, zk);
> LedgerManager m = mFactory.newLedgerManager();
> {code}
> m is not closed upon leaving the method.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)