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 "Junping Du (JIRA)" <ji...@apache.org> on 2014/05/13 11:56:16 UTC
[jira] [Commented] (MAPREDUCE-5861) finishedSubMaps field in
LocalContainerLauncher does not need to be volatile
[ https://issues.apache.org/jira/browse/MAPREDUCE-5861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13996234#comment-13996234 ]
Junping Du commented on MAPREDUCE-5861:
---------------------------------------
Agree volatile is not help here so better to remove it to get rid of confusing.
+1. Patch LGTM. Will commit it shortly.
> finishedSubMaps field in LocalContainerLauncher does not need to be volatile
> ----------------------------------------------------------------------------
>
> Key: MAPREDUCE-5861
> URL: https://issues.apache.org/jira/browse/MAPREDUCE-5861
> Project: Hadoop Map/Reduce
> Issue Type: Bug
> Reporter: Ted Yu
> Assignee: Tsuyoshi OZAWA
> Priority: Minor
> Attachments: MAPREDUCE-5861.1.patch, MAPREDUCE-5861.2.patch
>
>
> 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)