Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-16300 ebugs automated bug checker is reporting exception issues
  3. HADOOP-16295

FileUtil.replaceFile() throws an IOException when it is interrupted, which leads to an unnecessary disk check

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      Dear Hadoop developers, we are developing a tool to detect exception-related bugs in Java. Our prototype has spotted the following throw statement whose exception class and error message indicate different error conditions.

       

      Version: Hadoop-3.1.2

      File: HADOOP-ROOT/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java

      Line: 1387

      throw new IOException("replaceFile interrupted.");

       

      An IOException can mean many different errors, while the error message indicates that replaceFile() is interrupted. This mismatch could be a problem. For example, the callers trying to handle other IOException may accidentally (and incorrectly) handle the interrupt. An InterruptedIOException may be better here.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ebugs-in-cloud-systems Haicheng Chen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: