-
Bug
-
Resolution: Done
-
Blocker
-
3.0.0.Alpha1
-
None
When there are multiple sessions reading a node (e.g., reading the child references) while other sessions modify that node (e.g., add a child node), the reading sessions occasionally get a ConcurrentModificationException. This is happening because the Documents stored in Infinispan are being modified within a transaction, but the cached nodes in the workspace still have a reference to the now-changing Document content.
I created a test that submits 100 runnables to an executor (with a max of 50 threads), where each runnable obtains a session, adds a new uniquely-named node under the root node, saves the change, and then logs out. During most runs, one or two of the 100 threads get the following exception:
java.util.ConcurrentModificationException at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372) at java.util.AbstractList$Itr.next(AbstractList.java:343) at org.infinispan.schematic.internal.document.BasicArray$2.next(BasicArray.java:277) at org.modeshape.jcr.cache.document.DocumentTranslator.getChildReferences(DocumentTranslator.java:738) at org.modeshape.jcr.cache.document.LazyCachedNode.getChildReferences(LazyCachedNode.java:281) at org.modeshape.jcr.AbstractJcrNode.addChildNode(AbstractJcrNode.java:989) at org.modeshape.jcr.AbstractJcrNode.addNode(AbstractJcrNode.java:953) at org.modeshape.jcr.AbstractJcrNode.addNode(AbstractJcrNode.java:874) at org.modeshape.jcr.AbstractJcrNode.addNode(AbstractJcrNode.java:1) at org.modeshape.jcr.ModeShapeTckTest$1.run(ModeShapeTckTest.java:2541) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:680)
- relates to
-
MODE-1546 Various & intermittent NPE, NodeNotFoundException and NodeParentNotFoundException
- Closed