Hi,
I am running into an issue in a highly concurrent environment where my
threads are waiting on locking of the rule base when I try to insert into
the session. I am wondering if an appropriate solution would be to create a
pool of KnowledgeBase objects, each having its own rule base. A thread dump
of my server had the message below for about 40 threads.
For my use case, I create the knowledge base once, then don't modify it in
any way.
Thank you!
Travis
"ajp-bio-8010-exec-984" daemon prio=10 tid=0x081f3800 nid=0x2a7c waiting on
condition [0x9f368000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0xf0489a50> (a
java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
at
java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:834)
at
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:867)
at
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1197)
at
java.util.concurrent.locks.ReentrantReadWriteLock$WriteLock.lock(ReentrantReadWriteLock.java:945)
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:475)
at
org.drools.reteoo.builder.PatternBuilder.attachObjectTypeNode(PatternBuilder.java:276)
at
org.drools.reteoo.ClassObjectTypeConf.<init>(ClassObjectTypeConf.java:103)
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:434)
at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:993)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:335)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:311)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:903)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)
at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)
--
View this message in context:
http://drools.46999.n3.nabble.com/Pooling-KnowledgeBase-instances-tp40279...
Sent from the Drools: User forum mailing list archive at
Nabble.com.