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

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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: 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.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: