[JBoss JIRA] (WFLY-6338) Infinispan subsystem XSD disagrees with TransactionResourceDefinition on default locking mode
by Radoslav Husar (JIRA)
[ https://issues.jboss.org/browse/WFLY-6338?page=com.atlassian.jira.plugin.... ]
Radoslav Husar commented on WFLY-6338:
--------------------------------------
BTW one way to check for the value actually used without going through code is via CLI
{code}
[standalone@localhost:9990 /] /subsystem=infinispan/cache-container=web/distributed-cache=dist/component=transaction:read-attribute(name=locking,include-defaults=false
{
"outcome" => "success",
"result" => undefined
}
[standalone@localhost:9990 /] /subsystem=infinispan/cache-container=web/distributed-cache=dist/component=transaction:read-attribute(name=locking,include-defaults=true
{
"outcome" => "success",
"result" => "PESSIMISTIC"
}
{code}
> Infinispan subsystem XSD disagrees with TransactionResourceDefinition on default locking mode
> ---------------------------------------------------------------------------------------------
>
> Key: WFLY-6338
> URL: https://issues.jboss.org/browse/WFLY-6338
> Project: WildFly
> Issue Type: Bug
> Components: Clustering
> Affects Versions: 10.0.0.Final
> Reporter: Michal Vinkler
> Assignee: Radoslav Husar
> Priority: Blocker
>
> The XSD for the Infinispan subsystem ([jboss-as-infinispan_4_0.xsd|https://github.com/jbossas/jboss-eap7/blob/7....]) says that the default locking level is {{OPTIMISTIC}}:
> {code:xml}
> <xs:complexType name="transaction">
> ...
> <xs:attribute name="locking" type="tns:locking-mode" default="OPTIMISTIC">
> <xs:annotation>
> <xs:documentation>The locking mode for this cache, one of OPTIMISTIC or PESSIMISTIC.</xs:documentation>
> </xs:annotation>
> </xs:attribute>
> </xs:complexType>
> {code}
> However, the [TransactionResourceDefinition|https://github.com/jbossas/jboss-eap7/blob/...] class, which is the ultimate source of truth, disagrees:
> {code:java}
> enum Attribute implements org.jboss.as.clustering.controller.Attribute {
> LOCKING("locking", ModelType.STRING, new ModelNode(LockingMode.PESSIMISTIC.name()), new EnumValidatorBuilder<>(LockingMode.class)),
> ...
> }
> {code}
> I'm not sure myself which one should be the default, but this difference is surely a bug.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 1 month
[JBoss JIRA] (WFLY-6338) Infinispan subsystem XSD disagrees with TransactionResourceDefinition on default locking mode
by Radoslav Husar (JIRA)
[ https://issues.jboss.org/browse/WFLY-6338?page=com.atlassian.jira.plugin.... ]
Radoslav Husar edited comment on WFLY-6338 at 3/9/16 5:09 AM:
--------------------------------------------------------------
BTW one way to check for the value actually used without going through code is via CLI
{code}
[standalone@localhost:9990 /] /subsystem=infinispan/cache-container=web/distributed-cache=dist/component=transaction:read-attribute(name=locking,include-defaults=false
{
"outcome" => "success",
"result" => undefined
}
[standalone@localhost:9990 /] /subsystem=infinispan/cache-container=web/distributed-cache=dist/component=transaction:read-attribute(name=locking,include-defaults=true
{
"outcome" => "success",
"result" => "PESSIMISTIC"
}
{code}
PESSIMISTIC is the desirable value, so XSD is wrong here
was (Author: rhusar):
BTW one way to check for the value actually used without going through code is via CLI
{code}
[standalone@localhost:9990 /] /subsystem=infinispan/cache-container=web/distributed-cache=dist/component=transaction:read-attribute(name=locking,include-defaults=false
{
"outcome" => "success",
"result" => undefined
}
[standalone@localhost:9990 /] /subsystem=infinispan/cache-container=web/distributed-cache=dist/component=transaction:read-attribute(name=locking,include-defaults=true
{
"outcome" => "success",
"result" => "PESSIMISTIC"
}
{code}
> Infinispan subsystem XSD disagrees with TransactionResourceDefinition on default locking mode
> ---------------------------------------------------------------------------------------------
>
> Key: WFLY-6338
> URL: https://issues.jboss.org/browse/WFLY-6338
> Project: WildFly
> Issue Type: Bug
> Components: Clustering
> Affects Versions: 10.0.0.Final
> Reporter: Michal Vinkler
> Assignee: Radoslav Husar
> Priority: Blocker
>
> The XSD for the Infinispan subsystem ([jboss-as-infinispan_4_0.xsd|https://github.com/jbossas/jboss-eap7/blob/7....]) says that the default locking level is {{OPTIMISTIC}}:
> {code:xml}
> <xs:complexType name="transaction">
> ...
> <xs:attribute name="locking" type="tns:locking-mode" default="OPTIMISTIC">
> <xs:annotation>
> <xs:documentation>The locking mode for this cache, one of OPTIMISTIC or PESSIMISTIC.</xs:documentation>
> </xs:annotation>
> </xs:attribute>
> </xs:complexType>
> {code}
> However, the [TransactionResourceDefinition|https://github.com/jbossas/jboss-eap7/blob/...] class, which is the ultimate source of truth, disagrees:
> {code:java}
> enum Attribute implements org.jboss.as.clustering.controller.Attribute {
> LOCKING("locking", ModelType.STRING, new ModelNode(LockingMode.PESSIMISTIC.name()), new EnumValidatorBuilder<>(LockingMode.class)),
> ...
> }
> {code}
> I'm not sure myself which one should be the default, but this difference is surely a bug.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 1 month
[JBoss JIRA] (WFLY-6338) Infinispan subsystem XSD disagrees with TransactionResourceDefinition on default locking mode
by Radoslav Husar (JIRA)
[ https://issues.jboss.org/browse/WFLY-6338?page=com.atlassian.jira.plugin.... ]
Radoslav Husar updated WFLY-6338:
---------------------------------
Summary: Infinispan subsystem XSD disagrees with TransactionResourceDefinition on default locking mode (was: Infinispan subsystem XSD disagrees with TransactionResourceDefinition on default locking level)
> Infinispan subsystem XSD disagrees with TransactionResourceDefinition on default locking mode
> ---------------------------------------------------------------------------------------------
>
> Key: WFLY-6338
> URL: https://issues.jboss.org/browse/WFLY-6338
> Project: WildFly
> Issue Type: Bug
> Components: Clustering
> Affects Versions: 10.0.0.Final
> Reporter: Michal Vinkler
> Assignee: Radoslav Husar
> Priority: Blocker
>
> The XSD for the Infinispan subsystem ([jboss-as-infinispan_4_0.xsd|https://github.com/jbossas/jboss-eap7/blob/7....]) says that the default locking level is {{OPTIMISTIC}}:
> {code:xml}
> <xs:complexType name="transaction">
> ...
> <xs:attribute name="locking" type="tns:locking-mode" default="OPTIMISTIC">
> <xs:annotation>
> <xs:documentation>The locking mode for this cache, one of OPTIMISTIC or PESSIMISTIC.</xs:documentation>
> </xs:annotation>
> </xs:attribute>
> </xs:complexType>
> {code}
> However, the [TransactionResourceDefinition|https://github.com/jbossas/jboss-eap7/blob/...] class, which is the ultimate source of truth, disagrees:
> {code:java}
> enum Attribute implements org.jboss.as.clustering.controller.Attribute {
> LOCKING("locking", ModelType.STRING, new ModelNode(LockingMode.PESSIMISTIC.name()), new EnumValidatorBuilder<>(LockingMode.class)),
> ...
> }
> {code}
> I'm not sure myself which one should be the default, but this difference is surely a bug.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 1 month
[JBoss JIRA] (DROOLS-1087) KieBase update wrong match for rules containing constraints over the accumulate
by Matteo Mortari (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1087?page=com.atlassian.jira.plugi... ]
Matteo Mortari updated DROOLS-1087:
-----------------------------------
Attachment: 20160309.DROOLS-1087.zip
> KieBase update wrong match for rules containing constraints over the accumulate
> -------------------------------------------------------------------------------
>
> Key: DROOLS-1087
> URL: https://issues.jboss.org/browse/DROOLS-1087
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 6.2.0.Final, 6.3.0.Final, 6.4.0.Beta2
> Reporter: Matteo Mortari
> Assignee: Mario Fusco
> Attachments: 20160309.DROOLS-1087.zip
>
>
> Ciao, I will attach reproducer with same style as {{org.drools.compiler.integrationtests.IncrementalCompilationTest.testIncrementalCompilation}} / {{testIncrementalCompilationWithRedeclares}}
> h2. Executive summary
> When performing KieBase update, rules containing constraints over the accumulate Event, are firing with wrong matches and/or firing for already seen matches and violating the no-loop.
> h2. Detailed description of the reproducer.
> Assume a KB starting with only these two rules:
> {code}
> declare Measurement
> @role(event)
> end
> rule "color RED seen in the last 2 minutes"
> no-loop
> when
> accumulate ( $token: Measurement( id == "color", $colorVal : val, $colorVal == "red") over window:time(2m);
> $mySet : collectSet( $colorVal ),
> $val : count($token) ;
> $val >= 1
> )
> then
> System.out.println("I have seen color RED in the last 2m "+$mySet);
> end
> rule "color GREEN seen in the last 2 minutes"
> no-loop
> when
> accumulate ( $token: Measurement( id == "color", $colorVal : val, $colorVal == "green") over window:time(2m);
> $mySet : collectSet( $colorVal ),
> $val : count($token) ;
> $val >= 1
> )
> then
> System.out.println("I have seen color GREEN in the last 2m "+$mySet);
> end
> {code}
> and then on upgrade/update, the same rule as above un-touched, but additionally the following rule:
> {code}
> rule "id X seen in the last 2 minutes"
> no-loop
> when
> accumulate ( $token: Measurement( id == "x", $colorVal : val) over window:time(2m);
> $mySet : collectSet( $colorVal ),
> $val : count($token) ;
> $val >= 1
> )
> then
> System.out.println("I have seen Measurement for id=x in the last 2m "+$mySet);
> end
> {code}
> Where {{Measurement}} just a POJO as per Kie Artifact, basically containing fields: {{String id;String val;}}
> with the following of Measurement insertions, one at each minute:
> {code}
> -> Measurement [id=color, val=red]
> (KB update here)
> -> Measurement [id=x, val=x]
> -> Measurement [id=color, val=green]
> ...
> {code}
> the following problems are highlighted:
> h6. Drools version 6.2.0.Final with Reteoo
> The problem is highlighted after the 2nd Measurment event insertion below, the rules "color GREEN seen in the last 2 minutes" and "id X seen in the last 2 minutes" are firing with wrong matches, because:
> * the rule "color GREEN seen in the last 2 minutes" should fire only for {{Measurement\[id=color, val=green]}} Events, which has not occured, and is matching instead over {{Measurement\[id=color, val=red]}}
> * the rule "id X seen in the last 2 minutes" should fire only for {{Measurement\[id=x, _]}} Events, but is considering also the {{Measurement\[id=color, _]}} event which occured earlier.
> {code}
> 2016-03-09 09:33:20,952 INFO [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (main) KieModule was added: MemoryKieModule[releaseId=org.test:test:1.0.0]
> 2016-03-09 09:33:21,240 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) There should be rules:
> 2016-03-09 09:33:21,240 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color RED seen in the last 2 minutes
> 2016-03-09 09:33:21,240 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color GREEN seen in the last 2 minutes
> 2016-03-09 09:33:21,240 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Creating kieSession
> 2016-03-09 09:33:21,319 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Now running data
> 2016-03-09 09:33:21,321 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 60000
> -> Measurement [id=color, val=red]
> I have seen color RED in the last 2m [red]
> 2016-03-09 09:33:21,539 INFO [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (main) KieModule was added: MemoryKieModule[releaseId=org.test:test:1.0.1]
> 2016-03-09 09:33:21,743 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Update of KB performed.
> 2016-03-09 09:33:21,744 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color RED seen in the last 2 minutes
> 2016-03-09 09:33:21,744 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color GREEN seen in the last 2 minutes
> 2016-03-09 09:33:21,744 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule id X seen in the last 2 minutes
> 2016-03-09 09:33:21,744 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 120000
> -> Measurement [id=x, val=x]
> I have seen Measurement for id=x in the last 2m [red, x]
> I have seen color GREEN in the last 2m [red]
> I have seen color RED in the last 2m [red]
> 2016-03-09 09:33:21,750 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 180000
> <- Measurement [id=color, val=red]
> -> Measurement [id=color, val=green]
> I have seen color GREEN in the last 2m [green]
> I have seen Measurement for id=x in the last 2m [x]
> 2016-03-09 09:33:21,752 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 240000
> <- Measurement [id=x, val=x]
> -> Measurement [id=color, val=blue]
> 2016-03-09 09:33:21,752 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Final checks
> {code}
> h6. Drools version 6.2.0.Final with Phreak
> NPE
> {code}
> java.lang.NullPointerException
> at org.drools.core.reteoo.NodeTypeEnums.isBetaNode(NodeTypeEnums.java:87)
> at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:252)
> 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:92)
> at org.drools.core.common.DefaultAgenda.evaluateEagerList(DefaultAgenda.java:1044)
> at org.drools.core.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:996)
> at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1302)
> at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1289)
> at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1262)
> at com.acme.accumulateUpgradeTest.RuleTest.test(RuleTest.java:185)
> {code}
> h6. Drools version 6.3.0.Final with Reteoo
> Not in scope of this JIRA record. I think this release had a bug when running with the setup of this reproducer because if I try I get NPE at {{org.drools.core.RuleBaseConfiguration.configureReteComponentFactory()}}
> h6. Drools version 6.3.0.Final with Phreak
> Same NPE as "6.2.0.Final with Phreak"
> h6. Drools version 6.4.0.Beta2 with Reteoo
> Same problem as "6.2.0.Final with Reteoo"
> h6. Drools version 6.4.0.Beta2 with Phreak
> Better, but I'm not sure why rule "color RED seen in the last 2 minutes" is firing again after the rule-update, it is no-loop and the conditions of the rules are the same as before the rule-update, hence I'm not sure why it fired again.
> {code}
> 2016-03-09 09:45:25,301 INFO [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (main) KieModule was added: MemoryKieModule[releaseId=org.test:test:1.0.0]
> 2016-03-09 09:45:25,594 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) There should be rules:
> 2016-03-09 09:45:25,594 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color RED seen in the last 2 minutes
> 2016-03-09 09:45:25,594 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color GREEN seen in the last 2 minutes
> 2016-03-09 09:45:25,594 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Creating kieSession
> 2016-03-09 09:45:25,696 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Now running data
> 2016-03-09 09:45:25,698 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 60000
> -> Measurement [id=color, val=red]
> I have seen color RED in the last 2m [red]
> 2016-03-09 09:45:25,854 INFO [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (main) KieModule was added: MemoryKieModule[releaseId=org.test:test:1.0.1]
> 2016-03-09 09:45:26,023 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Update of KB performed.
> 2016-03-09 09:45:26,023 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color RED seen in the last 2 minutes
> 2016-03-09 09:45:26,023 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color GREEN seen in the last 2 minutes
> 2016-03-09 09:45:26,023 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule id X seen in the last 2 minutes
> 2016-03-09 09:45:26,023 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 120000
> -> Measurement [id=x, val=x]
> I have seen color RED in the last 2m [red]
> I have seen Measurement for id=x in the last 2m [x]
> 2016-03-09 09:45:26,029 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 180000
> -> Measurement [id=color, val=green]
> <- Measurement [id=color, val=red]
> I have seen color GREEN in the last 2m [green]
> 2016-03-09 09:45:26,033 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 240000
> -> Measurement [id=color, val=blue]
> <- Measurement [id=x, val=x]
> 2016-03-09 09:45:26,033 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Final checks
> {code}
> h2. Final note.
> Please notice in the reproducer I've used {{setSourcePath}} to ".txt" because I'm aliging with the Drool's JUnit tests: https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test...
> However changing {{setSourcePath}} to ".drl" would NOT solve the problem, at least for the rule "id X seen in the last 2 minutes".
> Can you kindly advise, please?
> Thank you
> Ciao,
> MM
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 1 month
[JBoss JIRA] (DROOLS-1087) KieBase update wrong match for rules containing constraints over the accumulate
by Matteo Mortari (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1087?page=com.atlassian.jira.plugi... ]
Matteo Mortari updated DROOLS-1087:
-----------------------------------
Description:
Ciao, I will attach reproducer with same style as {{org.drools.compiler.integrationtests.IncrementalCompilationTest.testIncrementalCompilation}} / {{testIncrementalCompilationWithRedeclares}}
h2. Executive summary
When performing KieBase update, rules containing constraints over the accumulate Event, are firing with wrong matches and/or firing for already seen matches and violating the no-loop.
h2. Detailed description of the reproducer.
Assume a KB starting with only these two rules:
{code}
declare Measurement
@role(event)
end
rule "color RED seen in the last 2 minutes"
no-loop
when
accumulate ( $token: Measurement( id == "color", $colorVal : val, $colorVal == "red") over window:time(2m);
$mySet : collectSet( $colorVal ),
$val : count($token) ;
$val >= 1
)
then
System.out.println("I have seen color RED in the last 2m "+$mySet);
end
rule "color GREEN seen in the last 2 minutes"
no-loop
when
accumulate ( $token: Measurement( id == "color", $colorVal : val, $colorVal == "green") over window:time(2m);
$mySet : collectSet( $colorVal ),
$val : count($token) ;
$val >= 1
)
then
System.out.println("I have seen color GREEN in the last 2m "+$mySet);
end
{code}
and then on upgrade/update, the same rule as above un-touched, but additionally the following rule:
{code}
rule "id X seen in the last 2 minutes"
no-loop
when
accumulate ( $token: Measurement( id == "x", $colorVal : val) over window:time(2m);
$mySet : collectSet( $colorVal ),
$val : count($token) ;
$val >= 1
)
then
System.out.println("I have seen Measurement for id=x in the last 2m "+$mySet);
end
{code}
Where {{Measurement}} just a POJO as per Kie Artifact, basically containing fields: {{String id;String val;}}
with the following of Measurement insertions, one at each minute:
{code}
-> Measurement [id=color, val=red]
(KB update here)
-> Measurement [id=x, val=x]
-> Measurement [id=color, val=green]
...
{code}
the following problems are highlighted:
h6. Drools version 6.2.0.Final with Reteoo
The problem is highlighted after the 2nd Measurment event insertion below, the rules "color GREEN seen in the last 2 minutes" and "id X seen in the last 2 minutes" are firing with wrong matches, because:
* the rule "color GREEN seen in the last 2 minutes" should fire only for {{Measurement\[id=color, val=green]}} Events, which has not occured, and is matching instead over {{Measurement\[id=color, val=red]}}
* the rule "id X seen in the last 2 minutes" should fire only for {{Measurement\[id=x, _]}} Events, but is considering also the {{Measurement\[id=color, _]}} event which occured earlier.
{code}
2016-03-09 09:33:20,952 INFO [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (main) KieModule was added: MemoryKieModule[releaseId=org.test:test:1.0.0]
2016-03-09 09:33:21,240 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) There should be rules:
2016-03-09 09:33:21,240 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color RED seen in the last 2 minutes
2016-03-09 09:33:21,240 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color GREEN seen in the last 2 minutes
2016-03-09 09:33:21,240 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Creating kieSession
2016-03-09 09:33:21,319 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Now running data
2016-03-09 09:33:21,321 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 60000
-> Measurement [id=color, val=red]
I have seen color RED in the last 2m [red]
2016-03-09 09:33:21,539 INFO [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (main) KieModule was added: MemoryKieModule[releaseId=org.test:test:1.0.1]
2016-03-09 09:33:21,743 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Update of KB performed.
2016-03-09 09:33:21,744 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color RED seen in the last 2 minutes
2016-03-09 09:33:21,744 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color GREEN seen in the last 2 minutes
2016-03-09 09:33:21,744 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule id X seen in the last 2 minutes
2016-03-09 09:33:21,744 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 120000
-> Measurement [id=x, val=x]
I have seen Measurement for id=x in the last 2m [red, x]
I have seen color GREEN in the last 2m [red]
I have seen color RED in the last 2m [red]
2016-03-09 09:33:21,750 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 180000
<- Measurement [id=color, val=red]
-> Measurement [id=color, val=green]
I have seen color GREEN in the last 2m [green]
I have seen Measurement for id=x in the last 2m [x]
2016-03-09 09:33:21,752 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 240000
<- Measurement [id=x, val=x]
-> Measurement [id=color, val=blue]
2016-03-09 09:33:21,752 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Final checks
{code}
h6. Drools version 6.2.0.Final with Phreak
NPE
{code}
java.lang.NullPointerException
at org.drools.core.reteoo.NodeTypeEnums.isBetaNode(NodeTypeEnums.java:87)
at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:252)
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:92)
at org.drools.core.common.DefaultAgenda.evaluateEagerList(DefaultAgenda.java:1044)
at org.drools.core.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:996)
at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1302)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1289)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1262)
at com.acme.accumulateUpgradeTest.RuleTest.test(RuleTest.java:185)
{code}
h6. Drools version 6.3.0.Final with Reteoo
Not in scope of this JIRA record. I think this release had a bug when running with the setup of this reproducer because if I try I get NPE at {{org.drools.core.RuleBaseConfiguration.configureReteComponentFactory()}}
h6. Drools version 6.3.0.Final with Phreak
Same NPE as "6.2.0.Final with Phreak"
h6. Drools version 6.4.0.Beta2 with Reteoo
Same problem as "6.2.0.Final with Reteoo"
h6. Drools version 6.4.0.Beta2 with Phreak
Better, but I'm not sure why rule "color RED seen in the last 2 minutes" is firing again after the rule-update, it is no-loop and the conditions of the rules are the same as before the rule-update, hence I'm not sure why it fired again.
{code}
2016-03-09 09:45:25,301 INFO [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (main) KieModule was added: MemoryKieModule[releaseId=org.test:test:1.0.0]
2016-03-09 09:45:25,594 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) There should be rules:
2016-03-09 09:45:25,594 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color RED seen in the last 2 minutes
2016-03-09 09:45:25,594 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color GREEN seen in the last 2 minutes
2016-03-09 09:45:25,594 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Creating kieSession
2016-03-09 09:45:25,696 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Now running data
2016-03-09 09:45:25,698 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 60000
-> Measurement [id=color, val=red]
I have seen color RED in the last 2m [red]
2016-03-09 09:45:25,854 INFO [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (main) KieModule was added: MemoryKieModule[releaseId=org.test:test:1.0.1]
2016-03-09 09:45:26,023 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Update of KB performed.
2016-03-09 09:45:26,023 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color RED seen in the last 2 minutes
2016-03-09 09:45:26,023 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color GREEN seen in the last 2 minutes
2016-03-09 09:45:26,023 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule id X seen in the last 2 minutes
2016-03-09 09:45:26,023 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 120000
-> Measurement [id=x, val=x]
I have seen color RED in the last 2m [red]
I have seen Measurement for id=x in the last 2m [x]
2016-03-09 09:45:26,029 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 180000
-> Measurement [id=color, val=green]
<- Measurement [id=color, val=red]
I have seen color GREEN in the last 2m [green]
2016-03-09 09:45:26,033 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 240000
-> Measurement [id=color, val=blue]
<- Measurement [id=x, val=x]
2016-03-09 09:45:26,033 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Final checks
{code}
h2. Final note.
Please notice in the reproducer I've used {{setSourcePath}} to ".txt" because I'm aliging with the Drool's JUnit tests: https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test...
However changing {{setSourcePath}} to ".drl" would NOT solve the problem, at least for the rule "id X seen in the last 2 minutes".
Can you kindly advise, please?
Thank you
Ciao,
MM
was:
Ciao, I will attach reproducer with same style as {{org.drools.compiler.integrationtests.IncrementalCompilationTest.testIncrementalCompilation}} / {{testIncrementalCompilationWithRedeclares}}
h2. Executive summary
When performing KieBase update, rules containing constraints over the accumulate Event, are firing with wrong matches and/or firing for already seen matches and violating the no-loop.
h2. Detailed description of the reproducer.
Assume a KB starting with only these two rules:
{code}
declare Measurement
@role(event)
end
rule "color RED seen in the last 2 minutes"
no-loop
when
accumulate ( $token: Measurement( id == "color", $colorVal : val, $colorVal == "red") over window:time(2m);
$mySet : collectSet( $colorVal ),
$val : count($token) ;
$val >= 1
)
then
System.out.println("I have seen color RED in the last 2m "+$mySet);
end
rule "color GREEN seen in the last 2 minutes"
no-loop
when
accumulate ( $token: Measurement( id == "color", $colorVal : val, $colorVal == "green") over window:time(2m);
$mySet : collectSet( $colorVal ),
$val : count($token) ;
$val >= 1
)
then
System.out.println("I have seen color GREEN in the last 2m "+$mySet);
end
{code}
and then on upgrade/update, the same rule as above un-touched, but additionally the following rule:
{code}
rule "id X seen in the last 2 minutes"
no-loop
when
accumulate ( $token: Measurement( id == "x", $colorVal : val) over window:time(2m);
$mySet : collectSet( $colorVal ),
$val : count($token) ;
$val >= 1
)
then
System.out.println("I have seen Measurement for id=x in the last 2m "+$mySet);
end
{code}
Where {{Measurement}} just a POJO as per Kie Artifact, basically containing fields: {{String id;String val;}}
with the following of Measurement insertions, one at each minute:
{code}
-> Measurement [id=color, val=red]
(KB update here)
-> Measurement [id=x, val=x]
-> Measurement [id=color, val=green]
...
{code}
the following problems are highlighted:
h6. Drools version 6.2.0.Final with Reteoo
The problem is highlighted after the 2nd Measurment event insertion below, the rules "color GREEN seen in the last 2 minutes" and "id X seen in the last 2 minutes" are firing with wrong matches, because:
* the rule "color GREEN seen in the last 2 minutes" should fire only for {{Measurement\[id=color, val=green]}} Events, which has not occured, and is matching instead over {{Measurement\[id=color, val=red]}}
* the rule "id X seen in the last 2 minutes" should fire only for {{Measurement\[id=x, _]}} Events, but is considering also the {{Measurement\[id=color, _]}} event which occured earlier.
{code}
2016-03-09 09:33:20,952 INFO [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (main) KieModule was added: MemoryKieModule[releaseId=org.test:test:1.0.0]
2016-03-09 09:33:21,240 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) There should be rules:
2016-03-09 09:33:21,240 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color RED seen in the last 2 minutes
2016-03-09 09:33:21,240 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color GREEN seen in the last 2 minutes
2016-03-09 09:33:21,240 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Creating kieSession
2016-03-09 09:33:21,319 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Now running data
2016-03-09 09:33:21,321 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 60000
-> Measurement [id=color, val=red]
I have seen color RED in the last 2m [red]
2016-03-09 09:33:21,539 INFO [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (main) KieModule was added: MemoryKieModule[releaseId=org.test:test:1.0.1]
2016-03-09 09:33:21,743 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Update of KB performed.
2016-03-09 09:33:21,744 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color RED seen in the last 2 minutes
2016-03-09 09:33:21,744 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color GREEN seen in the last 2 minutes
2016-03-09 09:33:21,744 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule id X seen in the last 2 minutes
2016-03-09 09:33:21,744 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 120000
-> Measurement [id=x, val=x]
I have seen Measurement for id=x in the last 2m [red, x]
I have seen color GREEN in the last 2m [red]
I have seen color RED in the last 2m [red]
2016-03-09 09:33:21,750 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 180000
<- Measurement [id=color, val=red]
-> Measurement [id=color, val=green]
I have seen color GREEN in the last 2m [green]
I have seen Measurement for id=x in the last 2m [x]
2016-03-09 09:33:21,752 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 240000
<- Measurement [id=x, val=x]
-> Measurement [id=color, val=blue]
2016-03-09 09:33:21,752 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Final checks
{code}
h6. Drools version 6.2.0.Final with Phreak
NPE
{code}
java.lang.NullPointerException
at org.drools.core.reteoo.NodeTypeEnums.isBetaNode(NodeTypeEnums.java:87)
at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:252)
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:92)
at org.drools.core.common.DefaultAgenda.evaluateEagerList(DefaultAgenda.java:1044)
at org.drools.core.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:996)
at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1302)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1289)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1262)
at com.acme.accumulateUpgradeTest.RuleTest.test(RuleTest.java:185)
{code}
h6. Drools version 6.3.0.Final with Reteoo
Not in scope of this JIRA record. I think this release had a bug when running with the setup of this reproducer because if I try I get NPE at {{org.drools.core.RuleBaseConfiguration.configureReteComponentFactory()}}
h6. Drools version 6.3.0.Final with Phreak
Same NPE as "6.2.0.Final with Phreak"
h6. Drools version 6.4.0.Beta2 with Reteoo
Same problem as "6.2.0.Final with Reteoo"
h6. Drools version 6.4.0.Beta2 with Phreak
Better, but I'm not sure why rule "color RED seen in the last 2 minutes" is firing again after the rule-update, it is no-loop and the conditions of the rules are the same as before the rule-update, hence I'm not sure why it fired again.
{code}
2016-03-09 09:45:25,301 INFO [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (main) KieModule was added: MemoryKieModule[releaseId=org.test:test:1.0.0]
2016-03-09 09:45:25,594 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) There should be rules:
2016-03-09 09:45:25,594 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color RED seen in the last 2 minutes
2016-03-09 09:45:25,594 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color GREEN seen in the last 2 minutes
2016-03-09 09:45:25,594 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Creating kieSession
2016-03-09 09:45:25,696 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Now running data
2016-03-09 09:45:25,698 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 60000
-> Measurement [id=color, val=red]
I have seen color RED in the last 2m [red]
2016-03-09 09:45:25,854 INFO [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (main) KieModule was added: MemoryKieModule[releaseId=org.test:test:1.0.1]
2016-03-09 09:45:26,023 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Update of KB performed.
2016-03-09 09:45:26,023 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color RED seen in the last 2 minutes
2016-03-09 09:45:26,023 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color GREEN seen in the last 2 minutes
2016-03-09 09:45:26,023 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule id X seen in the last 2 minutes
2016-03-09 09:45:26,023 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 120000
-> Measurement [id=x, val=x]
I have seen color RED in the last 2m [red]
I have seen Measurement for id=x in the last 2m [x]
2016-03-09 09:45:26,029 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 180000
-> Measurement [id=color, val=green]
<- Measurement [id=color, val=red]
I have seen color GREEN in the last 2m [green]
2016-03-09 09:45:26,033 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 240000
-> Measurement [id=color, val=blue]
<- Measurement [id=x, val=x]
2016-03-09 09:45:26,033 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Final checks
{code}
h2. Final note.
Please notice in the reproducer I've used {{setSourcePath}} to ".txt" because I'm aliging with the Drool's JUnit tests: https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test...
However changing {{setSourcePath}} to ".drl" would NOT solve the problem, at least for the rule "id X seen in the last 2 minutes".
Can you kindly advise, please?
Thank you
Ciao,
MM
> KieBase update wrong match for rules containing constraints over the accumulate
> -------------------------------------------------------------------------------
>
> Key: DROOLS-1087
> URL: https://issues.jboss.org/browse/DROOLS-1087
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 6.2.0.Final, 6.3.0.Final, 6.4.0.Beta2
> Reporter: Matteo Mortari
> Assignee: Mario Fusco
>
> Ciao, I will attach reproducer with same style as {{org.drools.compiler.integrationtests.IncrementalCompilationTest.testIncrementalCompilation}} / {{testIncrementalCompilationWithRedeclares}}
> h2. Executive summary
> When performing KieBase update, rules containing constraints over the accumulate Event, are firing with wrong matches and/or firing for already seen matches and violating the no-loop.
> h2. Detailed description of the reproducer.
> Assume a KB starting with only these two rules:
> {code}
> declare Measurement
> @role(event)
> end
> rule "color RED seen in the last 2 minutes"
> no-loop
> when
> accumulate ( $token: Measurement( id == "color", $colorVal : val, $colorVal == "red") over window:time(2m);
> $mySet : collectSet( $colorVal ),
> $val : count($token) ;
> $val >= 1
> )
> then
> System.out.println("I have seen color RED in the last 2m "+$mySet);
> end
> rule "color GREEN seen in the last 2 minutes"
> no-loop
> when
> accumulate ( $token: Measurement( id == "color", $colorVal : val, $colorVal == "green") over window:time(2m);
> $mySet : collectSet( $colorVal ),
> $val : count($token) ;
> $val >= 1
> )
> then
> System.out.println("I have seen color GREEN in the last 2m "+$mySet);
> end
> {code}
> and then on upgrade/update, the same rule as above un-touched, but additionally the following rule:
> {code}
> rule "id X seen in the last 2 minutes"
> no-loop
> when
> accumulate ( $token: Measurement( id == "x", $colorVal : val) over window:time(2m);
> $mySet : collectSet( $colorVal ),
> $val : count($token) ;
> $val >= 1
> )
> then
> System.out.println("I have seen Measurement for id=x in the last 2m "+$mySet);
> end
> {code}
> Where {{Measurement}} just a POJO as per Kie Artifact, basically containing fields: {{String id;String val;}}
> with the following of Measurement insertions, one at each minute:
> {code}
> -> Measurement [id=color, val=red]
> (KB update here)
> -> Measurement [id=x, val=x]
> -> Measurement [id=color, val=green]
> ...
> {code}
> the following problems are highlighted:
> h6. Drools version 6.2.0.Final with Reteoo
> The problem is highlighted after the 2nd Measurment event insertion below, the rules "color GREEN seen in the last 2 minutes" and "id X seen in the last 2 minutes" are firing with wrong matches, because:
> * the rule "color GREEN seen in the last 2 minutes" should fire only for {{Measurement\[id=color, val=green]}} Events, which has not occured, and is matching instead over {{Measurement\[id=color, val=red]}}
> * the rule "id X seen in the last 2 minutes" should fire only for {{Measurement\[id=x, _]}} Events, but is considering also the {{Measurement\[id=color, _]}} event which occured earlier.
> {code}
> 2016-03-09 09:33:20,952 INFO [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (main) KieModule was added: MemoryKieModule[releaseId=org.test:test:1.0.0]
> 2016-03-09 09:33:21,240 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) There should be rules:
> 2016-03-09 09:33:21,240 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color RED seen in the last 2 minutes
> 2016-03-09 09:33:21,240 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color GREEN seen in the last 2 minutes
> 2016-03-09 09:33:21,240 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Creating kieSession
> 2016-03-09 09:33:21,319 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Now running data
> 2016-03-09 09:33:21,321 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 60000
> -> Measurement [id=color, val=red]
> I have seen color RED in the last 2m [red]
> 2016-03-09 09:33:21,539 INFO [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (main) KieModule was added: MemoryKieModule[releaseId=org.test:test:1.0.1]
> 2016-03-09 09:33:21,743 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Update of KB performed.
> 2016-03-09 09:33:21,744 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color RED seen in the last 2 minutes
> 2016-03-09 09:33:21,744 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color GREEN seen in the last 2 minutes
> 2016-03-09 09:33:21,744 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule id X seen in the last 2 minutes
> 2016-03-09 09:33:21,744 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 120000
> -> Measurement [id=x, val=x]
> I have seen Measurement for id=x in the last 2m [red, x]
> I have seen color GREEN in the last 2m [red]
> I have seen color RED in the last 2m [red]
> 2016-03-09 09:33:21,750 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 180000
> <- Measurement [id=color, val=red]
> -> Measurement [id=color, val=green]
> I have seen color GREEN in the last 2m [green]
> I have seen Measurement for id=x in the last 2m [x]
> 2016-03-09 09:33:21,752 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 240000
> <- Measurement [id=x, val=x]
> -> Measurement [id=color, val=blue]
> 2016-03-09 09:33:21,752 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Final checks
> {code}
> h6. Drools version 6.2.0.Final with Phreak
> NPE
> {code}
> java.lang.NullPointerException
> at org.drools.core.reteoo.NodeTypeEnums.isBetaNode(NodeTypeEnums.java:87)
> at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:252)
> 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:92)
> at org.drools.core.common.DefaultAgenda.evaluateEagerList(DefaultAgenda.java:1044)
> at org.drools.core.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:996)
> at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1302)
> at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1289)
> at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1262)
> at com.acme.accumulateUpgradeTest.RuleTest.test(RuleTest.java:185)
> {code}
> h6. Drools version 6.3.0.Final with Reteoo
> Not in scope of this JIRA record. I think this release had a bug when running with the setup of this reproducer because if I try I get NPE at {{org.drools.core.RuleBaseConfiguration.configureReteComponentFactory()}}
> h6. Drools version 6.3.0.Final with Phreak
> Same NPE as "6.2.0.Final with Phreak"
> h6. Drools version 6.4.0.Beta2 with Reteoo
> Same problem as "6.2.0.Final with Reteoo"
> h6. Drools version 6.4.0.Beta2 with Phreak
> Better, but I'm not sure why rule "color RED seen in the last 2 minutes" is firing again after the rule-update, it is no-loop and the conditions of the rules are the same as before the rule-update, hence I'm not sure why it fired again.
> {code}
> 2016-03-09 09:45:25,301 INFO [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (main) KieModule was added: MemoryKieModule[releaseId=org.test:test:1.0.0]
> 2016-03-09 09:45:25,594 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) There should be rules:
> 2016-03-09 09:45:25,594 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color RED seen in the last 2 minutes
> 2016-03-09 09:45:25,594 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color GREEN seen in the last 2 minutes
> 2016-03-09 09:45:25,594 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Creating kieSession
> 2016-03-09 09:45:25,696 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Now running data
> 2016-03-09 09:45:25,698 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 60000
> -> Measurement [id=color, val=red]
> I have seen color RED in the last 2m [red]
> 2016-03-09 09:45:25,854 INFO [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (main) KieModule was added: MemoryKieModule[releaseId=org.test:test:1.0.1]
> 2016-03-09 09:45:26,023 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Update of KB performed.
> 2016-03-09 09:45:26,023 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color RED seen in the last 2 minutes
> 2016-03-09 09:45:26,023 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color GREEN seen in the last 2 minutes
> 2016-03-09 09:45:26,023 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule id X seen in the last 2 minutes
> 2016-03-09 09:45:26,023 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 120000
> -> Measurement [id=x, val=x]
> I have seen color RED in the last 2m [red]
> I have seen Measurement for id=x in the last 2m [x]
> 2016-03-09 09:45:26,029 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 180000
> -> Measurement [id=color, val=green]
> <- Measurement [id=color, val=red]
> I have seen color GREEN in the last 2m [green]
> 2016-03-09 09:45:26,033 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 240000
> -> Measurement [id=color, val=blue]
> <- Measurement [id=x, val=x]
> 2016-03-09 09:45:26,033 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Final checks
> {code}
> h2. Final note.
> Please notice in the reproducer I've used {{setSourcePath}} to ".txt" because I'm aliging with the Drool's JUnit tests: https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test...
> However changing {{setSourcePath}} to ".drl" would NOT solve the problem, at least for the rule "id X seen in the last 2 minutes".
> Can you kindly advise, please?
> Thank you
> Ciao,
> MM
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 1 month
[JBoss JIRA] (DROOLS-1087) KieBase update wrong match for rules containing constraints over the accumulate
by Matteo Mortari (JIRA)
Matteo Mortari created DROOLS-1087:
--------------------------------------
Summary: KieBase update wrong match for rules containing constraints over the accumulate
Key: DROOLS-1087
URL: https://issues.jboss.org/browse/DROOLS-1087
Project: Drools
Issue Type: Bug
Components: core engine
Affects Versions: 6.4.0.Beta2, 6.3.0.Final, 6.2.0.Final
Reporter: Matteo Mortari
Assignee: Mario Fusco
Ciao, I will attach reproducer with same style as {{org.drools.compiler.integrationtests.IncrementalCompilationTest.testIncrementalCompilation}} / {{testIncrementalCompilationWithRedeclares}}
h2. Executive summary
When performing KieBase update, rules containing constraints over the accumulate Event, are firing with wrong matches and/or firing for already seen matches and violating the no-loop.
h2. Detailed description of the reproducer.
Assume a KB starting with only these two rules:
{code}
declare Measurement
@role(event)
end
rule "color RED seen in the last 2 minutes"
no-loop
when
accumulate ( $token: Measurement( id == "color", $colorVal : val, $colorVal == "red") over window:time(2m);
$mySet : collectSet( $colorVal ),
$val : count($token) ;
$val >= 1
)
then
System.out.println("I have seen color RED in the last 2m "+$mySet);
end
rule "color GREEN seen in the last 2 minutes"
no-loop
when
accumulate ( $token: Measurement( id == "color", $colorVal : val, $colorVal == "green") over window:time(2m);
$mySet : collectSet( $colorVal ),
$val : count($token) ;
$val >= 1
)
then
System.out.println("I have seen color GREEN in the last 2m "+$mySet);
end
{code}
and then on upgrade/update, the same rule as above un-touched, but additionally the following rule:
{code}
rule "id X seen in the last 2 minutes"
no-loop
when
accumulate ( $token: Measurement( id == "x", $colorVal : val) over window:time(2m);
$mySet : collectSet( $colorVal ),
$val : count($token) ;
$val >= 1
)
then
System.out.println("I have seen Measurement for id=x in the last 2m "+$mySet);
end
{code}
Where {{Measurement}} just a POJO as per Kie Artifact, basically containing fields: {{String id;String val;}}
with the following of Measurement insertions, one at each minute:
{code}
-> Measurement [id=color, val=red]
(KB update here)
-> Measurement [id=x, val=x]
-> Measurement [id=color, val=green]
...
{code}
the following problems are highlighted:
h6. Drools version 6.2.0.Final with Reteoo
The problem is highlighted after the 2nd Measurment event insertion below, the rules "color GREEN seen in the last 2 minutes" and "id X seen in the last 2 minutes" are firing with wrong matches, because:
* the rule "color GREEN seen in the last 2 minutes" should fire only for {{Measurement\[id=color, val=green]}} Events, which has not occured, and is matching instead over {{Measurement\[id=color, val=red]}}
* the rule "id X seen in the last 2 minutes" should fire only for {{Measurement\[id=x, _]}} Events, but is considering also the {{Measurement\[id=color, _]}} event which occured earlier.
{code}
2016-03-09 09:33:20,952 INFO [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (main) KieModule was added: MemoryKieModule[releaseId=org.test:test:1.0.0]
2016-03-09 09:33:21,240 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) There should be rules:
2016-03-09 09:33:21,240 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color RED seen in the last 2 minutes
2016-03-09 09:33:21,240 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color GREEN seen in the last 2 minutes
2016-03-09 09:33:21,240 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Creating kieSession
2016-03-09 09:33:21,319 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Now running data
2016-03-09 09:33:21,321 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 60000
-> Measurement [id=color, val=red]
I have seen color RED in the last 2m [red]
2016-03-09 09:33:21,539 INFO [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (main) KieModule was added: MemoryKieModule[releaseId=org.test:test:1.0.1]
2016-03-09 09:33:21,743 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Update of KB performed.
2016-03-09 09:33:21,744 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color RED seen in the last 2 minutes
2016-03-09 09:33:21,744 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color GREEN seen in the last 2 minutes
2016-03-09 09:33:21,744 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule id X seen in the last 2 minutes
2016-03-09 09:33:21,744 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 120000
-> Measurement [id=x, val=x]
I have seen Measurement for id=x in the last 2m [red, x]
I have seen color GREEN in the last 2m [red]
I have seen color RED in the last 2m [red]
2016-03-09 09:33:21,750 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 180000
<- Measurement [id=color, val=red]
-> Measurement [id=color, val=green]
I have seen color GREEN in the last 2m [green]
I have seen Measurement for id=x in the last 2m [x]
2016-03-09 09:33:21,752 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 240000
<- Measurement [id=x, val=x]
-> Measurement [id=color, val=blue]
2016-03-09 09:33:21,752 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Final checks
{code}
h6. Drools version 6.2.0.Final with Phreak
NPE
{code}
java.lang.NullPointerException
at org.drools.core.reteoo.NodeTypeEnums.isBetaNode(NodeTypeEnums.java:87)
at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:252)
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:92)
at org.drools.core.common.DefaultAgenda.evaluateEagerList(DefaultAgenda.java:1044)
at org.drools.core.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:996)
at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1302)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1289)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1262)
at com.acme.accumulateUpgradeTest.RuleTest.test(RuleTest.java:185)
{code}
h6. Drools version 6.3.0.Final with Reteoo
Not in scope of this JIRA record. I think this release had a bug when running with the setup of this reproducer because if I try I get NPE at {{org.drools.core.RuleBaseConfiguration.configureReteComponentFactory()}}
h6. Drools version 6.3.0.Final with Phreak
Same NPE as "6.2.0.Final with Phreak"
h6. Drools version 6.4.0.Beta2 with Reteoo
Same problem as "6.2.0.Final with Reteoo"
h6. Drools version 6.4.0.Beta2 with Phreak
Better, but I'm not sure why rule "color RED seen in the last 2 minutes" is firing again after the rule-update, it is no-loop and the conditions of the rules are the same as before the rule-update, hence I'm not sure why it fired again.
{code}
2016-03-09 09:45:25,301 INFO [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (main) KieModule was added: MemoryKieModule[releaseId=org.test:test:1.0.0]
2016-03-09 09:45:25,594 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) There should be rules:
2016-03-09 09:45:25,594 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color RED seen in the last 2 minutes
2016-03-09 09:45:25,594 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color GREEN seen in the last 2 minutes
2016-03-09 09:45:25,594 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Creating kieSession
2016-03-09 09:45:25,696 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Now running data
2016-03-09 09:45:25,698 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 60000
-> Measurement [id=color, val=red]
I have seen color RED in the last 2m [red]
2016-03-09 09:45:25,854 INFO [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (main) KieModule was added: MemoryKieModule[releaseId=org.test:test:1.0.1]
2016-03-09 09:45:26,023 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Update of KB performed.
2016-03-09 09:45:26,023 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color RED seen in the last 2 minutes
2016-03-09 09:45:26,023 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule color GREEN seen in the last 2 minutes
2016-03-09 09:45:26,023 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) kp [Package name=com.acme.accumulateUpgradeTest] rule id X seen in the last 2 minutes
2016-03-09 09:45:26,023 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 120000
-> Measurement [id=x, val=x]
I have seen color RED in the last 2m [red]
I have seen Measurement for id=x in the last 2m [x]
2016-03-09 09:45:26,029 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 180000
-> Measurement [id=color, val=green]
<- Measurement [id=color, val=red]
I have seen color GREEN in the last 2m [green]
2016-03-09 09:45:26,033 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) advance clock @ 240000
-> Measurement [id=color, val=blue]
<- Measurement [id=x, val=x]
2016-03-09 09:45:26,033 INFO [com.acme.accumulateUpgradeTest.RuleTest] (main) Final checks
{code}
h2. Final note.
Please notice in the reproducer I've used {{setSourcePath}} to ".txt" because I'm aliging with the Drool's JUnit tests: https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test...
However changing {{setSourcePath}} to ".drl" would NOT solve the problem, at least for the rule "id X seen in the last 2 minutes".
Can you kindly advise, please?
Thank you
Ciao,
MM
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 1 month
[JBoss JIRA] (WFLY-4840) Deprecated element cluster-passivation-store from ejb subsystem does not work
by Dominik Pospisil (JIRA)
[ https://issues.jboss.org/browse/WFLY-4840?page=com.atlassian.jira.plugin.... ]
Dominik Pospisil resolved WFLY-4840.
------------------------------------
Resolution: Rejected
Seems that the feature is working as expected. Closing as rejected based on above comments and discussion with QA.
> Deprecated element cluster-passivation-store from ejb subsystem does not work
> -----------------------------------------------------------------------------
>
> Key: WFLY-4840
> URL: https://issues.jboss.org/browse/WFLY-4840
> Project: WildFly
> Issue Type: Bug
> Components: EJB
> Reporter: Ondřej Chaloupka
> Assignee: Dominik Pospisil
> Priority: Minor
>
> There is a mismatch in behaviour of deprecated element {{cluster-passivation-store}} under {{ejb}} subsystem.
> When element is deprecated still it should work and only prints warning that it's deprecated.
> {code}
> [standalone@localhost:9990 /] /subsystem=ejb3/cluster-passivation-store=infinispan:read-resource()
> {
> "outcome" => "failed",
> "failure-description" => "WFLYCTL0216: Management resource '[
> (\"subsystem\" => \"ejb3\"),
> (\"cluster-passivation-store\" => \"infinispan\")
> ]' not found",
> "rolled-back" => true
> }
> {code}
> but
> {code}
> [standalone@localhost:9990 /] /subsystem=ejb3/cluster-passivation-store=infinispan:add()
> {
> "outcome" => "failed",
> "failure-description" => "WFLYCTL0158: Operation handler failed: org.jboss.msc.service.DuplicateServiceException: Service jboss.ejb.cache.factory.distributable.infinispan is already registered",
> "rolled-back" => true
> }
> {code}
> _A note:_ the element {{cluster-passivation-store}} was replaced by {{passivation-store}} which works fine
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 1 month