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-3554) LineRecordReader needs more synchronization
Date Mon, 16 Jun 2008 13:55:46 GMT

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

Aaron Greenhouse commented on HADOOP-3554:
------------------------------------------

Chris,

I will regenerate the patch with SVN with the annotations removed.

Honestly, I don't know if the this class is used by multiple threads or not.  I haven't even
run HADOOP.  As stated above, my attention was drawn to this class through the use of FindBugs
through SureLogic Sierra.  This class was flagged by FindBugs because it had partial synchronization.
 I describe above how to fix the synchronization.  But if, it is the case that instances of
the class are not meant to be shared across threads, then no synchronization is necessary,
the class documentation should indicate that instances of the class should not be used by
more than 1 thread, and all the existing sychronization in the class should be removed.


> LineRecordReader needs more synchronization
> -------------------------------------------
>
>                 Key: HADOOP-3554
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3554
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.17.0
>         Environment: All java platforms
>            Reporter: Aaron Greenhouse
>         Attachments: LineRecordReader.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> LineRecordReader has three index fields start, end, and pos.  All of these fields are
long, which means that, in general, access to them is not atomic.  This can cause problems
if the fields are accessed without appropriate synchronization.  
> I propose the following changes to the class:
> - Make the fields start and end final.  This requires some minor changes to the constructor
LineRecordReader(Configuration, FileSplit).
> - Make the method getProgress() synchronized.

-- 
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