[rules-users] Getting deadlock-like thread state
Bojan Janisch
bojan.janisch at scai.fraunhofer.de
Tue Jul 23 09:11:29 EDT 2013
> If you run each of these sessions alone does you get the same problem? or this only happens when you try to run multiple sessions in parallel??
I've never had any problems while running Drools single threaded. But that is not the case, I cannot run one only one session at the same time.
The performance deficit would be enormous. Also I'm creating everything from scratch if I want to use Drools. Each time I'm creating a KnowledgeBuilder, putting my rule into it.
Generating a KnowledgeBase and putting the KnowledgePackages into it and getting a StatefulKnowledgeSession where I'm inserting my objects. I don't reuse any code.
Could the reason of the deadlock be, that the synchronization of notifyHalt() doesn't work properly because I'm running multiple sessions? But the sessions shouldn't have
any contentions to each other, I wanted them completely separated. But then is the question, how can I start drools to run multiple sessions?
Thanks and greetings
Bojan
----- Ursprüngliche Mail -----
Von: "Mauricio Salatino" <salaboy at gmail.com>
An: "Rules Users List" <rules-users at lists.jboss.org>
Gesendet: Dienstag, 23. Juli 2013 14:44:57
Betreff: Re: [rules-users] Getting deadlock-like thread state
If you run each of these sessions alone does you get the same problem? or this only happens when you try to run multiple sessions in parallel??
On Tue, Jul 23, 2013 at 1:33 PM, Bojan Janisch < bojan.janisch at scai.fraunhofer.de > wrote:
Hey drools users,
I'm running drools multiple times in parallel with ECJ (genetic algorithm framework). Also I'm running ECJ multiple times in parallel (evaluation purpose).
But each time I want to run ECJ, after an unspecific time, one thread is running infinite long while ECJ waits for it to finish. Additionally to this my
working memory is steadily growing while hanging in this deadlock-like state, though this might not be due to drools. This goes on until I get an gc out of
memory exception.
I've created a threaddump which always looks so:
java.lang.Thread.State: RUNNABLE
at java.lang.Object.notifyAll(Native Method)
at org.drools.common.DefaultAgenda.notifyHalt(DefaultAgenda.java:1478)
- locked <0x00002af5f3b0fe88> (a java.util.concurrent.atomic.AtomicBoolean)
at org.drools.common.DefaultAgenda.addActivation(DefaultAgenda.java:466)
at org.drools.common.DefaultAgenda.addActivation(DefaultAgenda.java:326)
at org.drools.reteoo.RuleTerminalNode.assertLeftTuple(RuleTerminalNode.java:259)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:196)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:71)
at org.drools.reteoo.JoinNode.propagateFromLeft(JoinNode.java:107)
at org.drools.reteoo.JoinNode.assertLeftTuple(JoinNode.java:95)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:196)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:71)
at org.drools.reteoo.JoinNode.propagateFromLeft(JoinNode.java:107)
at org.drools.reteoo.JoinNode.assertLeftTuple(JoinNode.java:95)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:196)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:71)
at org.drools.reteoo.JoinNode.propagateFromRight(JoinNode.java:159)
at org.drools.reteoo.JoinNode.assertObject(JoinNode.java:148)
at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:382)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:350)
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)
at rulevolution.RulEvolution.runDrools(RulEvolution.java:343)
at rulevolution.RulEvolution.evaluate(RulEvolution.java:185)
at ec.simple.SimpleEvaluator.evalPopChunk(SimpleEvaluator.java:259)
at ec.simple.SimpleEvaluator$SimpleEvaluatorThreadCG.run(SimpleEvaluator.java:341)
at ec.util.ThreadPool$PoolThread.run(ThreadPool.java:57)
Locked ownable synchronizers:
- <0x00002af5f3ae95d0> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
To my Programm:
Rules are generated in parallel and for each rule, a new KnowledgeBase, KnowledgeBuilder and StatefulKnowledgeSession is created.
Objects are inserted into the session and the rule is fired. The session will be disposed after no facts matches my rule or 1000
conclusions are fired.
I've searched the net for a similar problem, but with no success. Does someone know why Drools get into such a thread state and
how to get out of it?
I appreciate any help.
Bojan
_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
- MyJourney @ http://salaboy.com
- Co-Founder @ http://www.jugargentina.org
- Co-Founder @ http://www.jbug.com.ar
- Salatino "Salaboy" Mauricio -
_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
More information about the rules-users
mailing list