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

In NNStorage.java, IOExceptions of stream closures can mask root exceptions.

    Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.24.0
    • Fix Version/s: 3.0.0, 2.0.2-alpha
    • Component/s: namenode
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      In NNStorage.java:
      There are many stream closures in finally block.
      There is a chance that they can mask the root exceptions.

      So, better to follow the pattern like below:

        try{
           ............
           ............
           stream.close();
           stream =null;
         }
         finally{
           IOUtils.cleanup(LOG, stream);
         }
      
      1. HDFS-2330.patch
        2 kB
        Uma Maheswara Rao G
      2. HDFS-2330.patch
        2 kB
        Uma Maheswara Rao G

        Activity

        Uma Maheswara Rao G created issue -
        Uma Maheswara Rao G made changes -
        Field Original Value New Value
        Summary Stream exceptions in stream closures in NNStorage.java can mask root exceptions. In NNStorage.java, IOExceptions of stream closures can mask root exceptions.
        Uma Maheswara Rao G made changes -
        Attachment HDFS-2330.patch [ 12494372 ]
        Uma Maheswara Rao G made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Uma Maheswara Rao G made changes -
        Description In NNStorage.java:
          There are many stream closures in finally block.
          There is a chance that they can can mask the root exceptions.

        So, better to follow the pattern like below:

          try{
             ............
             ............
             stream.close();
             stream =null;
           }
           finally{
             IOUtils.cleanup(LOG, stream);
           }
        In NNStorage.java:
          There are many stream closures in finally block.
          There is a chance that they can mask the root exceptions.

        So, better to follow the pattern like below:
        {code}
          try{
             ............
             ............
             stream.close();
             stream =null;
           }
           finally{
             IOUtils.cleanup(LOG, stream);
           }
        {code}
        Uma Maheswara Rao G made changes -
        Attachment HDFS-2330.patch [ 12494467 ]
        Tsz Wo Nicholas Sze made changes -
        Hadoop Flags [Reviewed]
        Fix Version/s 0.24.0 [ 12317653 ]
        Tsz Wo Nicholas Sze made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Arun C Murthy made changes -
        Fix Version/s 3.0.0 [ 12320356 ]
        Fix Version/s 0.24.0 [ 12317653 ]
        Todd Lipcon made changes -
        Fix Version/s 2.2.0-alpha [ 12322472 ]
        Arun C Murthy made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development