Details

      Description

      The latest build of the HDFS-5535 branch (rolling upgrades) shows five new findbugs warnings.

      1. HDFS-6020.patch
        3 kB
        Kihwal Lee
      2. HDFS-6020.patch
        3 kB
        Kihwal Lee

        Activity

        Hide
        Kihwal Lee added a comment -

        The patch fixes 4 findbugs warnings.

        • Three were for ignoring return value of File.delete(). Moved them into a conditional statement and added logging.
        • Fourth was for not closing a FileWriter instance in some cases. This was originally ignored since it is non-critical and during shutdown. A finally block has been added to close it at all times.

        The fifth warning is not something introduced by recent changes. There already is an entry in the exception list for this. So I am not fixing this.

        <Match>
        <Class name="org.apache.hadoop.hdfs.DFSClient$DFSOutputStream$DataStreamer$ResponseProcessor" />
        <Method name="run" />
        <Bug pattern="REC_CATCH_EXCEPTION" />
        </Match>

        Show
        Kihwal Lee added a comment - The patch fixes 4 findbugs warnings. Three were for ignoring return value of File.delete(). Moved them into a conditional statement and added logging. Fourth was for not closing a FileWriter instance in some cases. This was originally ignored since it is non-critical and during shutdown. A finally block has been added to close it at all times. The fifth warning is not something introduced by recent changes. There already is an entry in the exception list for this. So I am not fixing this. <Match> <Class name="org.apache.hadoop.hdfs.DFSClient$DFSOutputStream$DataStreamer$ResponseProcessor" /> <Method name="run" /> <Bug pattern="REC_CATCH_EXCEPTION" /> </Match>
        Hide
        Chris Nauroth added a comment -

        Hi, Kihwal. This patch looks good. Minor nit: the finally block for closing the FileWriter could be simplified to a one-liner using IOUtils#cleanup or IOUtils#closeStream. +1 after that's addressed. Thanks!

        Show
        Chris Nauroth added a comment - Hi, Kihwal. This patch looks good. Minor nit: the finally block for closing the FileWriter could be simplified to a one-liner using IOUtils#cleanup or IOUtils#closeStream . +1 after that's addressed. Thanks!
        Hide
        Kihwal Lee added a comment -

        Thanks for the review, Chris. It is now calling IOUtils.cleanup().

        Show
        Kihwal Lee added a comment - Thanks for the review, Chris. It is now calling IOUtils.cleanup().
        Hide
        Chris Nauroth added a comment -

        +1 Thanks again!

        Show
        Chris Nauroth added a comment - +1 Thanks again!
        Hide
        Kihwal Lee added a comment -

        I've committed this to the RU branch.

        Show
        Kihwal Lee added a comment - I've committed this to the RU branch.
        Hide
        Tsz Wo Nicholas Sze added a comment -

        The class name in findbugsExcludeFile.xml is incorrect; filed HDFS-6025.

        Show
        Tsz Wo Nicholas Sze added a comment - The class name in findbugsExcludeFile.xml is incorrect; filed HDFS-6025 .

          People

          • Assignee:
            Kihwal Lee
            Reporter:
            Kihwal Lee
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development