Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-43 Ignoring IOExceptions on close
  3. HDFS-2364

metaSave API is using Printwriter, It will eat all the IOExceptions.

    Details

    • Type: Sub-task Sub-task
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: namenode
    • Labels:
      None

      Description

      It is important to note that
      PrintStream and PrintWriter do not throw IOExceptions! IOException is a
      non-Runtime exception, which means that your code must catch them or declare it
      can throw them.

      The creators of Java realized that System.out and System.err would be very
      heavily used, and did not want to force inclusion of exception handling every time
      you wanted to write System.out.println(4).
      Therefore, PrintStream and PrintWriter catch their own exceptions and set an
      error flag. If you are using one of these classes for real output in your program
      (not merely using System.out.println()) you should call checkError() to see
      if an error has occurred.
      Because of this behavior, PrintStream and PrintWriter are not well suited for
      use other than System.out and System.err!

      Ref: http://www.cs.usfca.edu/~parrt/doc/java/JavaIO-notes.pdf

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Uma Maheswara Rao G
            Reporter:
            Uma Maheswara Rao G
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development