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

FsShell can suppress the real error if no error message is present

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.7.1, 2.7.3
    • Fix Version/s: 2.8.0, 3.0.0-alpha2
    • Component/s: fs
    • Labels:
    • Hadoop Flags:
      Reviewed

      Description

      The FsShell error handling assumes in displayError() that the message argument is not null. However in the case where it is this leads to a NPE which results in suppressing the actual error information since a higher level of error handling kicks in and just dumps the stack trace of the NPE instead.

      e.g.

      Exception in thread "main" java.lang.NullPointerException
      	at org.apache.hadoop.fs.FsShell.displayError(FsShell.java:304)
      	at org.apache.hadoop.fs.FsShell.run(FsShell.java:289)
      	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
      	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:84)
      	at org.apache.hadoop.fs.FsShell.main(FsShell.java:340)
      

      This is deeply unhelpful because depending on what the underlying error was there may be no stack dumped/logged for it (as HADOOP-7114 provides) since FsShell doesn't explicitly dump traces for IllegalArgumentException which appears to be the underlying cause of my issue. Line 289 is where displayError() is called for IllegalArgumentException handling and that catch clause does not log the error.

        Attachments

        1. HADOOP-13824.001.patch
          4 kB
          John Zhuge
        2. HADOOP-13824.002.patch
          10 kB
          John Zhuge
        3. HADOOP-13824.003.patch
          8 kB
          John Zhuge

          Activity

            People

            • Assignee:
              jzhuge John Zhuge
              Reporter:
              rvesse Rob Vesse
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: