Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-14526

Examine code base for cases that exception is thrown from finally block

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      If exception X is thrown in try block, and exception Y is thrown is finally block, X will be swallowed.

      In addition, finally block is used to ensure resources are released properly in general. If we throw exception from there, some resources may be leaked. So it's not recommended to throw exception in the finally block

      I caught one today and reported HDFS-11974, creating this jira as a master one to catch other similar cases.

      Hope there is some static analyzer to find all.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              yzhangal Yongjun Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: