Hadoop Common
  1. Hadoop Common
  2. HADOOP-10363

Closing of SequenceFile.Reader / SequenceFile.Writer in DistCh should check against null

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Not A Problem
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Here is related code:

            try {
              for(in = new SequenceFile.Reader(fs, srcs, job); in.next(key, value); ) {
      ...
            finally {
              in.close();
            }
      
          SequenceFile.Writer opWriter = null;
          try {
            opWriter = SequenceFile.createWriter(fs, jobconf, opList, Text.class,
                FileOperation.class, SequenceFile.CompressionType.NONE);
      ...
          } finally {
            opWriter.close();
          }
      

      If ctor of Reader / Writer throws exception, the close() would be called on null object.

      1. HADOOP-10363.patch
        0.8 kB
        Sanghyun Yun

        Activity

        Ted Yu created issue -
        Sanghyun Yun made changes -
        Field Original Value New Value
        Attachment HADOOP-10363.patch [ 12662725 ]
        Sanghyun Yun made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Allen Wittenauer made changes -
        Labels BB2015-05-TBR
        Varun Saxena made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        Varun Saxena made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Not A Problem [ 8 ]
        Varun Saxena made changes -
        Labels BB2015-05-TBR

          People

          • Assignee:
            Unassigned
            Reporter:
            Ted Yu
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development