hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Greenhouse (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HADOOP-3553) Nested class TaskTracker.TaskInProgress needs additional synchronization
Date Mon, 16 Jun 2008 16:05:45 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-3553?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12605330#action_12605330
] 

Aaron Greenhouse commented on HADOOP-3553:
------------------------------------------

Per Nigel Daley's request, I should point out that this bug was discovered using Sierra from
SureLogic to view FindBug results. The bug was correct with the assistance of JSure from SureLogic.


> Nested class TaskTracker.TaskInProgress needs additional synchronization
> ------------------------------------------------------------------------
>
>                 Key: HADOOP-3553
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3553
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: mapred
>    Affects Versions: 0.17.0
>         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.


Mime
View raw message