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

Roman Leventov commented on YARN-10064:
---------------------------------------

If somebody wants to explore similar issues: I checked the production classes 
on the first page or this Github search: 
[https://github.com/apache/hadoop/search?p=1&q=synchronizedMap&unscoped_q=synchronizedMap]
 and didn't found similar problems in classes other than AuxServices. I didn't 
check the 2nd and 3rd page or results though, neither did I search for 
synchronizedList, synchronizedSet, synchronizedSortedMap, etc. 

> Potential race conditions in AuxServices
> ----------------------------------------
>
>                 Key: YARN-10064
>                 URL: https://issues.apache.org/jira/browse/YARN-10064
>             Project: Hadoop YARN
>          Issue Type: Bug
>            Reporter: Roman Leventov
>            Priority: Major
>
> There are three places in {{AuxServices}} class that may potentially cause 
> race conditions: {{getServices()}}, {{getServiceRecords()}}, 
> {{handle(AuxServicesEvent event)}}. In the first two methods, synchronized 
> collections are returned from the API. If they are iterated concurrently with 
> the underlying collections being updated inside {{AuxServices}}, 
> non-deterministic behavior may follow.
> In {{handle(AuxServicesEvent event)}}, {{serviceMap.values()}} is actually 
> iterated outside of a critical section on {{serviceMap}} object, though it's 
> unclear from the class itself whether handle() may be called concurrently 
> with the methods on {{AuxServices}} that modify {{serviceMap}} or not. So if 
> this not a bug, adding a comment explaining this would be helpful.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org

Reply via email to