Drools - fireUntilHalt锁定KnowledgeBase

时间:2015-11-24 10:21:36

标签: multithreading drools

我有一个调用kieSession.fireUntilHalt的守护程序线程。事实是从其他线程(http)插入的。

在某些时候,'射击'线程进入“等待”状态并且永远不会返回。因此插入线程的其他事实在此线程上被阻止。

规则触发线程堆栈:

at sun.misc.Unsafe.park(Native Method) 
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.core.common.UpgradableReentrantReadWriteLock.lowPriorityWriteLock(UpgradableReentrantReadWriteLock.java:109) 
at org.drools.core.common.UpgradableReentrantReadWriteLock.writeLock(UpgradableReentrantReadWriteLock.java:95) 
at org.drools.core.impl.KnowledgeBaseImpl.lock(KnowledgeBaseImpl.java:684) 
at org.drools.core.reteoo.builder.PatternBuilder.attachObjectTypeNode(PatternBuilder.java:275) 
at org.drools.core.reteoo.ClassObjectTypeConf. (ClassObjectTypeConf.java:107) 
at org.drools.core.common.ObjectTypeConfigurationRegistry.getObjectTypeConf(ObjectTypeConfigurationRegistry.java:72) 
at org.drools.core.reteoo.AccumulateNode.createResultFactHandle(AccumulateNode.java:149) 
at org.drools.core.phreak.PhreakAccumulateNode.evaluateResultConstraints(PhreakAccumulateNode.java:683) 
at org.drools.core.phreak.PhreakAccumulateNode.doNode(PhreakAccumulateNode.java:89) 
at org.drools.core.phreak.RuleNetworkEvaluator.switchOnDoBetaNode(RuleNetworkEvaluator.java:563) 
at org.drools.core.phreak.RuleNetworkEvaluator.evalBetaNode(RuleNetworkEvaluator.java:534) 
at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:334) 
at org.drools.core.phreak.RuleNetworkEvaluator.outerEval(RuleNetworkEvaluator.java:161) 
at org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:116) 
at org.drools.core.phreak.RuleExecutor.evaluateNetwork(RuleExecutor.java:77) 
- locked [0x00000000fe586af0] (a org.drools.core.phreak.RuleExecutor) 
at org.drools.core.common.DefaultAgenda.evaluateEagerList(DefaultAgenda.java:990) 
- locked [0x000000008ad60cd8] (a java.util.LinkedList) 
at org.drools.core.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:945) 
at org.drools.core.common.DefaultAgenda.fireUntilHalt(DefaultAgenda.java:1190) 
at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireUntilHalt(StatefulKnowledgeSessionImpl.java:1283) 
at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireUntilHalt(StatefulKnowledgeSessionImpl.java:1260) 
at com.comp.narch.lfc.decision.rules.util.FireUntilHaltSpawn.call(FireUntilHaltSpawn.java:21) 
at com.comp.narch.lfc.decision.rules.util.FireUntilHaltSpawn.call(FireUntilHaltSpawn.java:11)

事实插入线程(已阻止)堆栈:

at org.drools.core.common.DefaultAgenda.addEagerRuleAgendaItem(DefaultAgenda.java:282) 
- waiting to lock [0x000000008ad60cd8] (a java.util.LinkedList) 
at org.drools.core.reteoo.PathMemory.queueRuleAgendaItem(PathMemory.java:153) 
at org.drools.core.reteoo.PathMemory.doLinkRule(PathMemory.java:120) 
- locked [0x00000000fe586928] (a org.drools.core.reteoo.PathMemory) 
at org.drools.core.reteoo.PathMemory.linkSegment(PathMemory.java:90) 
at org.drools.core.reteoo.SegmentMemory.notifyRuleLinkSegment(SegmentMemory.java:170) 
at org.drools.core.reteoo.LeftInputAdapterNode$LiaNodeMemory.setNodeDirty(LeftInputAdapterNode.java:647) 
at org.drools.core.reteoo.LeftInputAdapterNode.doInsertSegmentMemory(LeftInputAdapterNode.java:277) 
at org.drools.core.reteoo.LeftInputAdapterNode.doInsertObject(LeftInputAdapterNode.java:229) 
at org.drools.core.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:197) 
at org.drools.core.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:502) 
at org.drools.core.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:387) 
at org.drools.core.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:288) 
at org.drools.core.reteoo.EntryPointNode.assertObject(EntryPointNode.java:251) 
at org.drools.core.common.NamedEntryPoint.insert(NamedEntryPoint.java:367) 
at org.drools.core.common.NamedEntryPoint.insert(NamedEntryPoint.java:286) 
at org.drools.core.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:1430) 
at org.drools.core.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:1372) 
at com.comp.narch.lfc.service.impl.DefaultServiceInstanceMgmtServiceImpl.newAppMetric(DefaultServiceInstanceMgmtServiceImpl.java:84)

Drools Version - 6.1.0.Final

0 个答案:

没有答案