hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Mackrory (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HBASE-15891) Closeable resources potentially not getting closed if exception is thrown
Date Thu, 26 May 2016 17:43:12 GMT

     [ https://issues.apache.org/jira/browse/HBASE-15891?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Sean Mackrory updated HBASE-15891:
    Attachment: HBASE-15891-v1.patch

Attaching a patch. I've looked at all uses of RpcClientImpl and they do all appear to call
close() in a finally block, with the possible exception of some instances where the class
has been wrapped in other objects 3 or 4 layers deep in test code, and some of them would
be quite tricky to change. Not worth it, IMO.

> Closeable resources potentially not getting closed if exception is thrown
> -------------------------------------------------------------------------
>                 Key: HBASE-15891
>                 URL: https://issues.apache.org/jira/browse/HBASE-15891
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Sean Mackrory
>            Priority: Minor
>         Attachments: HBASE-15891-v1.patch
> Static code analysis reports several instances of Closeable resources getting closed
outside of 'finally' blocks - so if an Exception is thrown it may not get closed.
> {code}
> ZKUtil.getServerStats
> CoprocessorClassLoader.init
> LogLevel.process
> JarFinder.createJar
> RpcClientImpl.setupIOstreams
> {code}
> Most of these are straightforward. RpcClientImpl wraps the resource potentially multiple
times and the resource needs to remain open after the method returns, so I intend to not fix
that. Really, any use of that class should be wrapped in a finally and IT should get closed.

This message was sent by Atlassian JIRA

View raw message