[ 
https://issues.apache.org/jira/browse/MAPREDUCE-4737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13639574#comment-13639574
 ] 

Chris Nauroth commented on MAPREDUCE-4737:
------------------------------------------

The new patches look good, and the new tests are very helpful.  I ran some 
tests on Windows using both trunk and branch-1-win, and they passed.

I have a question on this part:

{code}
    try {
      runner.run(in, new OldOutputCollector(collector, conf), reporter);
      mapPhase.complete();
      // start the sort phase only if there are reducers
      if (numReduceTasks > 0) {
        setPhase(TaskStatus.Phase.SORT);
      }
      statusUpdate(umbilical);
      collector.flush();
      
      in.close();
      in = null;
      
      collector.close();
      collector = null;
    } finally {
      closeQuietly(in);
      closeQuietly(collector);
    }
{code}

Is it necessary to close in the try block, considering that close is guaranteed 
to happen again in the finally block?  Also, why bother to set local variables 
in and collector to null?  Attempting to encourage garbage collection to clean 
them up faster?  Something else?
                
>  Hadoop does not close output file / does not call Mapper.cleanup if 
> exception in map
> -------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-4737
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-4737
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>    Affects Versions: 1-win, 2.0.3-alpha, 1.1.2
>            Reporter: Daniel Dai
>            Assignee: Arun C Murthy
>         Attachments: HADOOP-23-2.patch, HADOOP-8904-1.patch, 
> MAPREDUCE-4737_branch1.patch, MAPREDUCE-4737_branch1.patch, 
> MAPREDUCE-4737.patch, MAPREDUCE-4737.patch, MAPREDUCE-4737.patch
>
>
> Find this in Pig unit test TestStore under Windows. There are dangling files 
> because map does not close the file when exception happens in map(). In 
> Windows, Hadoop will not remove a file if it is not closed. This happens in 
> reduce() as well.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to