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

Closeable resources potentially not getting closed if exception is thrown

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.0.0
    • None
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: