[jboss-jira] [JBoss JIRA] (DROOLS-4572) a fact with many properties causes a problem with "not" rule in executable-model
Toshiya Kobayashi (Jira)
issues at jboss.org
Fri Sep 27 05:39:00 EDT 2019
[ https://issues.jboss.org/browse/DROOLS-4572?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13790076#comment-13790076 ]
Toshiya Kobayashi commented on DROOLS-4572:
-------------------------------------------
Some analysis:
"A fact which has more than 128 properties" means it creates an OpenBitSet with wlen = 3.
https://github.com/kiegroup/drools/blob/master/drools-model/drools-canonical-model/src/main/java/org/drools/model/bitmask/OpenBitSet.java#L93
This 3 length array mask seems to have a problem in intersect in JoinNode (BetaNode.modifyObject()). intersects() with rightInferredMask (which is 2 length array mask) always returns false so it doesn't reach NotNode.
https://github.com/kiegroup/drools/blob/master/drools-core/src/main/java/org/drools/core/reteoo/BetaNode.java#L350
If you reduce the number of properties (e.g. comment out from field120 to field129 in ManyPropFact.java in the unit test), you will see that the intersects() returns true so it will reach NotNode.
> a fact with many properties causes a problem with "not" rule in executable-model
> --------------------------------------------------------------------------------
>
> Key: DROOLS-4572
> URL: https://issues.jboss.org/browse/DROOLS-4572
> Project: Drools
> Issue Type: Bug
> Components: executable model
> Affects Versions: 7.27.0.Final
> Environment: - executable-model
> - Without property reactive
> Reporter: Toshiya Kobayashi
> Assignee: Luca Molteni
> Priority: Major
> Labels: support
>
> Under the conditions:
> - executable-model
> - "drools.propertySpecific" = "ALLOWED"
> - A fact which has more than 128 properties
> - A rule with "not" which joins facts
> "not" doesn't match so the rule results in an unexpected firing (e.g. an infinite loop)
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
More information about the jboss-jira
mailing list