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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Not A Problem
    • None
    • None
    • None
    • 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.

      Attachments

        1. HADOOP-10363.patch
          0.8 kB
          Sanghyun Yun

        Activity

          People

            Unassigned Unassigned
            yuzhihong@gmail.com Ted Yu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: