]
Krzysztof Sobolewski updated JBCACHE-1553:
------------------------------------------
Attachment: LoadChildrenChildLockingTest.java
Even more updated test without duplicate method and with proper set up / tear down.
Potential possibility to avoid some (most?) locking in
CacheLoaderInterceptor.loadChildren()
--------------------------------------------------------------------------------------------
Key: JBCACHE-1553
URL:
https://jira.jboss.org/jira/browse/JBCACHE-1553
Project: JBoss Cache
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Cache loaders
Affects Versions: 3.2.1.GA
Reporter: Krzysztof Sobolewski
Assignee: Manik Surtani
Attachments: LoadChildrenChildLockingTest-fix.diff,
LoadChildrenChildLockingTest-fix.diff, LoadChildrenChildLockingTest.java,
LoadChildrenChildLockingTest.java, LoadChildrenChildLockingTest.java
We create new nodes in memory with "children loaded" flag always set to false,
because we cannot efficiently check whether this is a purely new node or it exists in
evicted state. This flag can be happily set to false for a very long time, until someone
calls getChildrenNames() (or similar); at this moment CacheLoaderInterceptor decides it
must load the node's children from the cache loader, in case there are some that
weren't accessed recently enough for them to be activated. In the process, it locks
the node *and* all the children nodes.
I think the locking of children can be avoided if the child was already in memory. I
filed this as a bug because it caused real problems in our application (with locking in
unexpected moments and places).
I'm attaching a test case and a patch that worked for me, but, as usual, causes
unknown collateral damage :)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: