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

Nested AutoCloseables might not all get closed

    XMLWordPrintableJSON

    Details

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

      Description

      Subtle problem in HBASE-15891:

      try (A myA = new A(new B()))

      An exception thrown between B starting to open an A finishing initialization may not result in B being closed. A safer syntax would be:

      try(B myB = new B(); A myA = newA(myB))

        Attachments

        1. HBASE-16035-v1.patch
          2 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: