Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-3502

Deadlock trying to do concurrent insertions on the same KnowledgeSession

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Done
    • None
    • 5.4.0.Final
    • None
    • None

    Description

      Concurrent insertions on the same KnowledgeSession ends up in a deadlock with 2 threads waiting each other as it follows:

      Thread-1@1667 daemon, prio=5, in group 'main', status: 'WAIT'
      at sun.misc.Unsafe.park(Unsafe.java:-1)
      at java.util.concurrent.locks.LockSupport.park(LockSupport.java:156)
      at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:811)
      at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:842)
      at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1178)
      at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:186)
      at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:262)
      at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:172)
      at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:888)
      at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)
      at org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)

      Thread-0@1666 daemon, prio=5, in group 'main', status: 'WAIT'
      at sun.misc.Unsafe.park(Unsafe.java:-1)
      at java.util.concurrent.locks.LockSupport.park(LockSupport.java:156)
      at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:811)
      at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:842)
      at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1178)
      at java.util.concurrent.locks.ReentrantReadWriteLock$WriteLock.lock(ReentrantReadWriteLock.java:807)
      at org.drools.common.UpgradableReentrantReadWriteLock.lowPriorityWriteLock(UpgradableReentrantReadWriteLock.java:105)
      at org.drools.common.UpgradableReentrantReadWriteLock.writeLock(UpgradableReentrantReadWriteLock.java:88)
      at org.drools.common.AbstractRuleBase.lock(AbstractRuleBase.java:472)
      at org.drools.reteoo.builder.PatternBuilder.attachObjectTypeNode(PatternBuilder.java:266)
      at org.drools.reteoo.ClassObjectTypeConf.<init>(ClassObjectTypeConf.java:99)
      at org.drools.common.ObjectTypeConfigurationRegistry.getObjectTypeConf(ObjectTypeConfigurationRegistry.java:71)
      at org.drools.reteoo.Rete.assertObject(Rete.java:107)
      at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:286)
      at org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction.execute(ReteooWorkingMemory.java:435)
      at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:977)
      at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:322)
      at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:298)
      at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:888)
      at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)
      at org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)

      Attachments

        Activity

          People

            mfusco@redhat.com Mario Fusco
            mfusco@redhat.com Mario Fusco
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: