chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florian Müller (JIRA) <j...@apache.org>
Subject [jira] [Resolved] (CMIS-769) CacheImpl is not thread safe (org.apache.chemistry.opencmis.client.bindings.cache.impl.CacheImpl)
Date Wed, 19 Mar 2014 16:13:43 GMT

     [ https://issues.apache.org/jira/browse/CMIS-769?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Florian Müller resolved CMIS-769.
---------------------------------

       Resolution: Fixed
    Fix Version/s: OpenCMIS 0.11.0

Thanks for the report.

> CacheImpl is not thread safe (org.apache.chemistry.opencmis.client.bindings.cache.impl.CacheImpl)
> -------------------------------------------------------------------------------------------------
>
>                 Key: CMIS-769
>                 URL: https://issues.apache.org/jira/browse/CMIS-769
>             Project: Chemistry
>          Issue Type: Bug
>          Components: opencmis-client
>    Affects Versions: OpenCMIS 0.10.0
>            Reporter: Trask Stalnaker
>            Assignee: Florian Müller
>             Fix For: OpenCMIS 0.11.0
>
>
> We ended up with a thread stuck in an infinite loop at:
> java.lang.Thread.State: RUNNABLE
> java.util.LinkedHashMap.transfer(Unknown Source)
> java.util.HashMap.resize(Unknown Source)
> java.util.LinkedHashMap.addEntry(Unknown Source)
> java.util.HashMap.put(Unknown Source)
> org.apache.chemistry.opencmis.client.bindings.cache.impl.AbstractMapCacheLevel.put(AbstractMapCacheLevel.java:56)
> org.apache.chemistry.opencmis.client.bindings.cache.impl.CacheImpl.put(CacheImpl.java:191)
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.LinkCache.addLink(LinkCache.java:133)
> The issue seems to be that CacheImpl is using an access-ordered LinkedHashMap via LruCacheLevelImpl,
and CacheImpl is using a ReentrantReadWriteLock to synchronize access to the LinkedHashMap,
allowing multiple concurrent readers, which is ok for HashMap, but is not ok for an access-ordered
LinkedHashMap, see the bolded sentence at http://docs.oracle.com/javase/7/docs/api/java/util/LinkedHashMap.html:
> "In access-ordered linked hash maps, merely querying the map with get is a structural
modification."



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message