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 "Sangjin Lee (JIRA)" <ji...@apache.org> on 2014/04/28 17:22:15 UTC
[jira] [Commented] (MAPREDUCE-5861) LocalContainerLauncher does not
atomically update volatile variable finishedSubMaps
[ https://issues.apache.org/jira/browse/MAPREDUCE-5861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13983096#comment-13983096 ]
Sangjin Lee commented on MAPREDUCE-5861:
----------------------------------------
It was made volatile as part of MAPREDUCE-5841.
However, before that patch the subtask runner was single-threaded. So, I don't think volatile was necessary then (it is now).
> LocalContainerLauncher does not atomically update volatile variable finishedSubMaps
> -----------------------------------------------------------------------------------
>
> Key: MAPREDUCE-5861
> URL: https://issues.apache.org/jira/browse/MAPREDUCE-5861
> Project: Hadoop Map/Reduce
> Issue Type: Bug
> Reporter: Ted Yu
> Priority: Minor
>
> Around line 374:
> {code}
> if (++finishedSubMaps == numMapTasks) {
> doneWithMaps = true;
> }
> {code}
> The increment of finishedSubMaps is not atomic.
> See the answer to http://stackoverflow.com/questions/9749746/what-is-the-difference-of-atomic-volatile-synchronize .
> AtomicInteger can be used to achieve atomicity.
--
This message was sent by Atlassian JIRA
(v6.2#6252)