Did you do deadlock detection in a tool like jconsole?
--- On Thu, 8/6/09, Charles Binford <Charles.Binford@sun.com> wrote:
From: Charles Binford <Charles.Binford@sun.com>
Subject: [rules-users] multi-threaded deadlock?
To: "Rules Users List" <rules-users@lists.jboss.org>
Date: Thursday, August 6, 2009, 4:08 PM
All,
Drools 4.0.7.
I have a single rulebase and three threads running
stateless sessions
(each thread has it's own session). All appears to
work fine until I
try to dynamically update the packages in the
rulebase. That scenario
intermittently hangs on an apparent deadlock. The
documentation says,
"Packages can be added and removed at any time...", but
maybe this
wasn't assuming a multi-threaded context?
The stack trace of my three threads is below.
- Thread 10 is in the middle if fireAllRules
- Thread 12 is trying to add facts to its session
- thread 11 is trying to add a new package to the ruleBase,
but seems to
be in some flavor of fireAllRules on the ruleBase even
though there is
no session argument in this code path.
Am I breaking some fundamental drools rule for
multi-threading? Do I
need to lock out other sessions from activity while
updating packages?
Thanks
Charles Binford
"Thread-10"
java.lang.Object.wait(Object.java)
java.lang.Object.wait(Object.java:485)
org.drools.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:106)
org.drools.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:195)
org.drools.common.AbstractWorkingMemory.getFactHandleByIdentity(AbstractWorkingMemory.java:604)
org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:98)
com.sun.evtl.pe.customerPolicy.adm.rules.Rule_turn_on_batch_0.consequence(Rule_turn_on_batch_0.java:8)
com.sun.evtl.pe.customerPolicy.adm.rules.Rule_turn_on_batch_0ConsequenceInvoker.evaluate(Rule_turn_on_batch_0ConsequenceInvoker.java:22)
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
com.sun.evtl.pe.common.PolicyManager.fireRules(PolicyManager.java:353)
com.sun.evtl.pe.customerPolicy.adm.rules.ArchiveMgrThrd.fireRules(ArchiveMgrThrd.java:132)
com.sun.evtl.pe.customerPolicy.adm.rules.ArchiveMgrThrd.runEngine(ArchiveMgrThrd.java:51)
com.sun.evtl.pe.customerPolicy.adm.msg.PolicyListenerThrd.run(PolicyListenerThrd.java:57)
java.lang.Thread.run(Thread.java:619)
"Thread-11"
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
org.drools.base.FireAllRulesRuleBaseUpdateListener.beforeRuleBaseUnlocked(FireAllRulesRuleBaseUpdateListener.java:29)
org.drools.event.RuleBaseEventSupport.fireBeforeRuleBaseUnlocked(RuleBaseEventSupport.java:168)
org.drools.common.AbstractRuleBase.unlock(AbstractRuleBase.java:361)
org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:456)
com.sun.evtl.pe.common.PolicyManager.addPackage(PolicyManager.java:237)
com.sun.evtl.pe.customerPolicy.adm.rules.ArchiveMgr.loadNewUserRules(ArchiveMgr.java:170)
com.sun.evtl.pe.customerPolicy.adm.msg.PolicyListenerThrd.run(PolicyListenerThrd.java:78)
java.lang.Thread.run(Thread.java:619)
"Thread-12"
java.lang.Object.wait(Object.java)
java.lang.Object.wait(Object.java:485)
org.drools.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:106)
org.drools.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:195)
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:743)
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:704)
com.sun.evtl.pe.common.PolicyManager.insertSensor(PolicyManager.java:316)
com.sun.evtl.pe.customerPolicy.adm.rules.ArchiveMgrThrd.assertFacts(ArchiveMgrThrd.java:79)
com.sun.evtl.pe.customerPolicy.adm.rules.ArchiveMgrThrd.runEngine(ArchiveMgrThrd.java:50)
com.sun.evtl.pe.customerPolicy.adm.msg.PolicyListenerThrd.run(PolicyListenerThrd.java:57)
java.lang.Thread.run(Thread.java:619)
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users