You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-issues@hadoop.apache.org by "Allen Wittenauer (JIRA)" <ji...@apache.org> on 2014/07/18 07:35:06 UTC

[jira] [Resolved] (MAPREDUCE-60) Nested class TaskTracker.TaskInProgress needs additional synchronization

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

Allen Wittenauer resolved MAPREDUCE-60.
---------------------------------------

    Resolution: Incomplete

Closing this as stale.

> 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 was sent by Atlassian JIRA
(v6.2#6252)