[
https://issues.apache.org/jira/browse/HADOOP-6269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12756926#action_12756926
]
Konstantin Shvachko commented on HADOOP-6269:
---------------------------------------------
+1 The patch does the right thing synchronizing under-synchronized static
variable defaultResources.
BUT,
The most common cause of {{ConcurrentModificationException}} is not the lack of
synchronization, but rather the fact that something is modifying the collection
on which you are currently iterating (in the same thread).
In your case if somebody is modifying {{defaultResources}} inside
{{loadResource()}} then you get {{ConcurrentModificationException}}. And
synchronizing the loop will not help it.
I am just checking whether this fixes what it intends to fix.
> Missing synchronization for defaultResources in Configuration.addResource
> -------------------------------------------------------------------------
>
> Key: HADOOP-6269
> URL: https://issues.apache.org/jira/browse/HADOOP-6269
> Project: Hadoop Common
> Issue Type: Bug
> Components: conf
> Affects Versions: 0.20.1
> Reporter: Todd Lipcon
> Assignee: Todd Lipcon
> Fix For: 0.20.2, 0.21.0
>
> Attachments: hadoop-6269.txt
>
>
> Configuration.defaultResources is a simple ArrayList. In two places in
> Configuration it is accessed without appropriate synchronization, which we've
> seen to occasionally result in ConcurrentModificationExceptions.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.