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

Potentially unclosed SequenceFile.Writer in DistCpV1#setup()

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6.0
    • Fix Version/s: 2.7.0
    • Component/s: None
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

          SequenceFile.Writer src_writer = SequenceFile.createWriter(jobfs, jobConf,
              srcfilelist, LongWritable.class, FilePair.class,
              SequenceFile.CompressionType.NONE);
      
          Path dstfilelist = new Path(jobDirectory, "_distcp_dst_files");
          SequenceFile.Writer dst_writer = SequenceFile.createWriter(jobfs, jobConf,
              dstfilelist, Text.class, Text.class,
              SequenceFile.CompressionType.NONE);
      

      If creation of dst_writer throws exception, src_writer would be left unclosed since there is no finally clause doing that for the above code.

        Attachments

        1. HADOOP-11283.001.patch
          4 kB
          Varun Saxena
        2. HADOOP-11283.002.patch
          4 kB
          Varun Saxena
        3. HADOOP-11283.patch
          3 kB
          Varun Saxena

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: