Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-2418

NodeNotFoundInParentException when concurrently accessing a node

XMLWordPrintable

      As already reported in the linked forum thread, i'm encountering a NodeNotFoundInParentException when concurrently accessing the same node in multiple threads. The stacktrace varies (different API calls lead to the same error) but it always ends up in LazyCacheNode.parentReferenceToSelf like this:

      org.modeshape.jcr.cache.NodeNotFoundInParentException: Cannot locate child node: a69d00a317f1e7c7dc674b-807b-4330-aed9-bafeaf201ab3 within parent: a69d00a317f1e7aff38971-cd1c-4edf-9afe-76c960196183
      	at org.modeshape.jcr.cache.document.LazyCachedNode.parentReferenceToSelf(LazyCachedNode.java:247)
      	at org.modeshape.jcr.cache.document.LazyCachedNode.getSegment(LazyCachedNode.java:284)
      	at org.modeshape.jcr.cache.document.LazyCachedNode.getPath(LazyCachedNode.java:293)
      	at org.modeshape.jcr.JcrSession.node(JcrSession.java:560)
      	at org.modeshape.jcr.JcrSession.node(JcrSession.java:505)
      	at org.modeshape.jcr.JcrSession.node(JcrSession.java:483)
      	at org.modeshape.jcr.AbstractJcrNode.getBaseVersion(AbstractJcrNode.java:3221)
      	at org.modeshape.jcr.JcrVersionManager.checkin(JcrVersionManager.java:326)
      	at org.modeshape.jcr.JcrVersionManager.checkin(JcrVersionManager.java:295)
      	at de.doubleslash.modeshape.concurrentaccessbug.impl.UploadRunnable.call(UploadRunnable.java:46)
      	at de.doubleslash.modeshape.concurrentaccessbug.impl.UploadRunnable.call(UploadRunnable.java:17)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:744)
      

      As requested, i assembled a sample project to reproduce the problem.
      Just build it and run the test with maven. However, due to the nature of the problem, you may have to run it more than once to make the exception occur. I were not able yet to make it happen all the time.

      We are currently using ModeShape 4.0.0, but i also tried the sample with 4.1.0 and it does not make a difference.

              hchiorean Horia Chiorean (Inactive)
              jkreutzfeld_jira Jan Kreutzfeld (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: