[
https://issues.apache.org/jira/browse/APEXCORE-539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15514021#comment-15514021
]
Vlad Rozov commented on APEXCORE-539:
-------------------------------------
I see the following exception after I changed DefaultAttributeMap to store and
compare thread with the current thread:
{noformat}
2016-09-22 10:36:46,849 [container-0] ERROR stram.StramLocalCluster run -
Container container-0 failed
java.util.ConcurrentModificationException: current thread
Thread[container-0,5,main] existing thread Thread[main,5,main]
at
com.datatorrent.api.Attribute$AttributeMap$DefaultAttributeMap.put(Attribute.java:209)
at
com.datatorrent.stram.engine.StreamingContainer.setup(StreamingContainer.java:160)
at
com.datatorrent.stram.StramLocalCluster$LocalStreamingContainer.run(StramLocalCluster.java:178)
at
com.datatorrent.stram.StramLocalCluster$LocalStramChildLauncher.run(StramLocalCluster.java:269)
at java.lang.Thread.run(Thread.java:745)
{noformat}
Why not to use ConcurrentHashMap instead of HashMap?
> DefaultAttributeMap is not thread safe
> --------------------------------------
>
> Key: APEXCORE-539
> URL: https://issues.apache.org/jira/browse/APEXCORE-539
> Project: Apache Apex Core
> Issue Type: Bug
> Reporter: Vlad Rozov
>
> DefaultAttributeMap put() and get() methods may be called from different
> threads and current implementation that uses HashMap is not thread safe.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)