hadoop-yarn-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Omkar Vinit Joshi (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (YARN-573) Shared data structures in Public Localizer and Private Localizer are not Thread safe.
Date Wed, 31 Jul 2013 17:59:52 GMT

    [ https://issues.apache.org/jira/browse/YARN-573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13725505#comment-13725505
] 

Omkar Vinit Joshi commented on YARN-573:
----------------------------------------

[~jlowe] Thanks for reviewing..
bq. LocalizerRunner.pending is accessed without synchronization in the update() method. Maybe
it would be simpler to just use a SynchronizedList wrapper? That would make it a bit more
robust in light of maintenance changes in the future as well.
Yeah my bad.. missed update call... that should be fixed...regarding using synchronized list;
I thought about it earlier but we are using iterator internally and we are modifying list
using that iterator which won't be thread safe. Let me know if we should use Collections.synchronizedList
or should synchronize on list? Correct me if I am wrong anywhere.

bq. Nit: The PublicLocalizer constructor that takes a Map isn't really used, and as we know
pending can't be just any Map for it to work properly. I'd be tempted to remove that constructor,
but it's not a necessary change.
Yes you are right we should change the constructor to use ConcurrentMap. I will fix it together
with above question/comment.
                
> Shared data structures in Public Localizer and Private Localizer are not Thread safe.
> -------------------------------------------------------------------------------------
>
>                 Key: YARN-573
>                 URL: https://issues.apache.org/jira/browse/YARN-573
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>            Reporter: Omkar Vinit Joshi
>            Assignee: Omkar Vinit Joshi
>            Priority: Critical
>         Attachments: YARN-573-20130730.1.patch
>
>
> PublicLocalizer
> 1) pending accessed by addResource (part of event handling) and run method (as a part
of PublicLocalizer.run() ).
> PrivateLocalizer
> 1) pending accessed by addResource (part of event handling) and findNextResource (i.remove()).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message