Is this a bug of activation group or our usage?

566 views
Skip to first unread message

hanbing luo

unread,
Sep 23, 2015, 11:43:47 PM9/23/15
to Drools Usage
 Hi

When we do A/B test after migrating drools from 5.1.1 to 6.2.0 final we found an issue of activation group.

Issue description
Same rule flow group and activation group but different salience rules, expected behavior is high salience rule is fired and other rules are canceled. But in some cases two rules with same activation group both get fired.

Context
Our final goal is to get better performance time when call drools engine. As we know condition eval takes some time(one or two hundred ms level) when first time call drools engine. After first call you can get 1-5 ms processing time. So we designed a session pool to effectively reuse session and delete all objects in working memory after each calling. This solution works fine in 5.1.1 but sometimes issue happens in 6.2.0 final.
I searched below link and looks like it is a common request. But seems there is a bug in that post. Is there a drools team recommended way to get our final goal?
Approach to reuse KieSession
https://groups.google.com/forum/#!topic/drools-usage/-6iGRyrCr8M

I also did some investigation about this issue. Looks like when deleting one specific object from working memory(perhaps in cleaning cached nodes?) it messed up something. 
DefaultAgenda.addEagerRuleAgendaItem
In line 280 item.isInList() is true and returned. This makes this RuleAgendaItem not add to eager so it finally makes this rule not canceled.

Another thing I don't understand is this issue can't be reproduced even with same rule in another sample project. So I sent kjar to Mark and related guys in gmail.
I also attached sample project code to reproduce this issue.
run IssueReproduceMain

Let me know if you need any thing else.

Thanks
drools-6-clean-bugreport.zip

hanbing luo

unread,
Sep 24, 2015, 8:54:09 PM9/24/15
to Drools Usage
Update:

I see Mark's new response from another thread.
https://groups.google.com/forum/#!topic/drools-usage/ohFukWU5tNE

When changed to 6.3.0.CR2 in reproduce code pom this issue is not appeared any more. I will use 6.3.0.CR2 to do fully test.
------------------------------
There are some fixes here, can you try 6.3.CR2 please.

If the bug remains, please try and create a self contained unit test, and submit as a pull request.

https://docs.jboss.org/drools/release/6.3.0.CR2/drools-docs/html/ch01.html#gettingstarted

Mark

hanbing luo

unread,
Nov 9, 2015, 6:36:44 AM11/9/15
to Drools Usage
Hi guys

When fully test our rules using drools 6.3.0.Final we still found such activation group issue although 6.3.0.Final fixed a bug of my first demo project code.
More detail please refer
https://issues.jboss.org/browse/DROOLS-974

Excuse me I can't address it using a single and simple unit test.

Let me know if you need anything else.

Thanks a lot!

hanbing luo

unread,
Nov 26, 2015, 9:39:44 PM11/26/15
to Drools Usage
Hi

Is there some update about this bug? 
We are in a dilemma to get good performance time when upgrade drools from 5.1 to 6.x(6.1.0, 6.2.0 and 6.3.0.Final).
Solution A) 
Reuse kie session but sometimes have this activation group bug.
Solution B)
New kie session in each request. But we found another performance bug.

I want to know which solution is drools team suggested option. We will wait update if is solution B.

Thanks again.
Reply all
Reply to author
Forward
0 new messages