Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-15891

Closeable resources potentially not getting closed if exception is thrown

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      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.

      ZKUtil.getServerStats
      CoprocessorClassLoader.init
      LogLevel.process
      JarFinder.createJar
      RpcClientImpl.setupIOstreams
      

      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.

        Attachments

        1. HBASE-15891-v1.patch
          5 kB
          Sean Mackrory

          Activity

            People

            • Assignee:
              mackrorysd Sean Mackrory
              Reporter:
              mackrorysd Sean Mackrory
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: