[ 
https://issues.apache.org/jira/browse/MAPREDUCE-60?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Konstantin Boudnik updated MAPREDUCE-60:
----------------------------------------

    Tags: surelogic

> Nested class TaskTracker.TaskInProgress needs additional synchronization
> ------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-60
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-60
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>         Environment: All Java platforms
>            Reporter: Aaron Greenhouse
>         Attachments: HADOOP-3553.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The nested class TaskTracker.TaskInProgress needs additional synchronization 
> to work properly with the Java Memory Model.  Presumably this class is 
> accessed by more than one thread, because it already contains 
> synchronization.  However, it needs additional synchronization, especially to 
> protect access to the long fields lastProgressReport and taskTimeOut.  Long 
> fields are not guaranteed to be read/written atomically, so not only do you 
> risk reading stale values, but you risk reading corrupted values.
> The field wasKilled also needs synchronization, as it is polled from within 
> the TaskTracker class.  
> I suggest the following improvements to the class
> - Make the fields task and taskStatus final.  They are used this way already. 
>  Making them final clarifies there behavior in a current environment.
> - Add the synchronized modifier to the methods getLastProgressReport() and 
> getTaskTimeout().
> - Make the field wasKilled private and add a new public synchronized 
> wasKilled() getter method.  Replace the use of the field with this method in 
> TaskTracker.
> - Add a comment to localizeTask() indicating that the caller must be 
> synchronized on this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to