[JBoss JIRA] (DROOLS-4909) Infinite recursion in drools after version change from v7.20 to v7.21
by Crosson David (Jira)
[ https://issues.redhat.com/browse/DROOLS-4909?page=com.atlassian.jira.plug... ]
Crosson David commented on DROOLS-4909:
---------------------------------------
I was able to reproduce the issue, by reaching the same level of complexity as for our original KB :
[^toto.drl]
> Infinite recursion in drools after version change from v7.20 to v7.21
> ---------------------------------------------------------------------
>
> Key: DROOLS-4909
> URL: https://issues.redhat.com/browse/DROOLS-4909
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.21.0.Final, 7.22.0.Final, 7.23.0.Final, 7.25.0.Final, 7.31.0.Final
> Environment: Both Mac and Windows
> Reporter: Crosson David
> Assignee: Mario Fusco
> Priority: Major
> Attachments: Screen Shot 2019-07-10 at 3.53.10 PM.png, Screen Shot 2019-07-10 at 5.56.32 PM.png, Screen Shot 2019-07-10 at 5.59.28 PM.png, error.png, pojo.png, static.png, static_error.png, toto.drl
>
>
> https://issues.redhat.com/browse/DROOLS-4288
> The problem is not fully solved, I got a forever loop on my KB since 7.21.0.Final, I tried with 7.25.0.Final but without success, and the issue is still here with 7.31.0.Final. Will go back to release 7.20.0.Final
> (the only fix I can apply is to add no-loop clause to my rules although it shouldn't be necessary).
> I can't share the affected KB, and unfortunately I was unable to reproduce the issue loop on a smaller example
> The affected rule looks like :
> {{rule "reset metric to max score when no more issues are present"
> //no-loop // TODO - no-loop TO BE REMOVED AS IT SHOULDN'T BE NECESSARY
> when
> Something($id:identity, $origin:origin)
> not Issue($id == identity, $origin == origin, category!="metrics")
> $scoring: Scoring(name == "performance", $id == identity, $origin == origin)
> then
> modify($scoring)
> { setValue(100.0); }
> end}}
> ----
> from https://issues.redhat.com/browse/DROOLS-4288 :
> When there is a version change in drools-compiler from `7.20.0.Final` to `7.21.0.Final` some rules are looping recursively.
> *Code in github:*
> [The working version|https://github.com/padippist/DroolsIssueReporting/tree/issue_v_7.20]
> [The recursively looping version|https://github.com/padippist/DroolsIssueReporting/tree/issue_v_7.21]
> [The change between working and looping version|https://github.com/padippist/DroolsIssueReporting/compare/issue_v...]
> *More details*
> When I fire a rule whose `then` part modifies a fact that is already checked in the `when` part:
> {code:java}
> rule "rule 1.1"
> when
> $sampleDomain: SampleDomain(instanceVariable2 == "Value of instance variable")
> then
> System.out.println("Rule 1.1 fired");
> modify($sampleDomain){
> setInstanceVariable1(3)
> }
> end
> {code}
> it doesn't loop recursively.
> But when I call another rule which call a static function from another class:
> {code:java}
> rule "rule 1.2"
> when
> $sampleDomain: SampleDomain(CoreUtils.anotherFunction())
> then
> System.out.println("Rule 1.2 fired");
> modify($sampleDomain){
> setInstanceVariable1(3)
> }
> end
> {code}
> it loops recursively.
> The class with static function is
> {code:java}
> import com.drool_issue.domain.SampleDomain;
> public class CoreUtils {
>
> public static boolean anotherFunction() {
> System.out.println("anotherFunction() inside CoreUtils");
> return true;
> }
>
> public static boolean anotherFunction(SampleDomain sampleDomain) {
> System.out.println("anotherFunction(SampleDomain sampleDomain) inside CoreUtils");
> return true;
> }
> }
> {code}
> My domain file is:
> {code:java}
> public class SampleDomain {
> private int instanceVariable1;
> private String instanceVariable2;
> private int instanceVariable3;
>
>
> public int getInstanceVariable1() {
> return instanceVariable1;
> }
> public void setInstanceVariable1(int instanceVariable1) {
> this.instanceVariable1 = instanceVariable1;
> }
> public String getInstanceVariable2() {
> return instanceVariable2;
> }
> public void setInstanceVariable2(String instanceVariable2) {
> this.instanceVariable2 = instanceVariable2;
> }
> public int getInstanceVariable3() {
> return instanceVariable3;
> }
> public void setInstanceVariable3(int instanceVariable3) {
> this.instanceVariable3 = instanceVariable3;
> }
>
>
> }
> {code}
> This is only caused after version change from `7.20.0.Final` to `7.21.0.Final`. Any guess on what the problem might be?
> When I further looked into the problem I saw this too.
> When we add two functions into the `SampleDomain` class ie
> {code:java}
> public boolean anotherFunction() {
> return true;
> }
>
> public boolean anotherFunction(SampleDomain sampleDomain) {
> return true;
> }
> {code}
> and use this in the rule like:
> {code:java}
> rule "rule 1.4"
> when
> $sampleDomain: SampleDomain(anotherFunction())
> then
> System.out.println("Rule 1.4 fired");
> modify($sampleDomain){
> setInstanceVariable1(3)
> }
> end
> {code}
> and
> {code:java}
> rule "rule 1.5"
> when
> $sampleDomain: SampleDomain(anotherFunction($sampleDomain))
> then
> System.out.println("Rule 1.5 fired");
> modify($sampleDomain){
> setInstanceVariable3(4)
> }
> end
> {code}
> these also loops recursively.
> *Code in github:*
> [The recursive looping when using non static methods|https://github.com/padippist/DroolsIssueReporting/tree/issue_v_7....]
> [The change between working and above version|https://github.com/padippist/DroolsIssueReporting/compare/issue_v...]
> Also when any of the static method is made non static then method from the domain class is called even though the static method is specified in the rule.
> *Code portions to be noted here are:*
> [Rule where static method is called.|https://github.com/padippist/DroolsIssueReporting/blob/bde2804b25...]
> [Another rule which also call the static method.|https://github.com/padippist/DroolsIssueReporting/blob/bde2804b25...]
> [The static access modifier removed from the functions which where previously static.|https://github.com/padippist/DroolsIssueReporting/compare/issue_v...]
> *Code in github:*
> [Weird behaviour when removing static modifier for the functions.|https://github.com/padippist/DroolsIssueReporting/tree/issue_v...]
> [The change between working and above version|https://github.com/padippist/DroolsIssueReporting/compare/issue_v...]
> *All this are caused in versions after `7.20.0.Final`, ie `7.21.0.Final`, `7.22.0.Final` and `7.23.0.Final`*
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 10 months
[JBoss JIRA] (DROOLS-4909) Infinite recursion in drools after version change from v7.20 to v7.21
by Crosson David (Jira)
[ https://issues.redhat.com/browse/DROOLS-4909?page=com.atlassian.jira.plug... ]
Crosson David updated DROOLS-4909:
----------------------------------
Attachment: toto.drl
> Infinite recursion in drools after version change from v7.20 to v7.21
> ---------------------------------------------------------------------
>
> Key: DROOLS-4909
> URL: https://issues.redhat.com/browse/DROOLS-4909
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.21.0.Final, 7.22.0.Final, 7.23.0.Final, 7.25.0.Final, 7.31.0.Final
> Environment: Both Mac and Windows
> Reporter: Crosson David
> Assignee: Mario Fusco
> Priority: Major
> Attachments: Screen Shot 2019-07-10 at 3.53.10 PM.png, Screen Shot 2019-07-10 at 5.56.32 PM.png, Screen Shot 2019-07-10 at 5.59.28 PM.png, error.png, pojo.png, static.png, static_error.png, toto.drl
>
>
> https://issues.redhat.com/browse/DROOLS-4288
> The problem is not fully solved, I got a forever loop on my KB since 7.21.0.Final, I tried with 7.25.0.Final but without success, and the issue is still here with 7.31.0.Final. Will go back to release 7.20.0.Final
> (the only fix I can apply is to add no-loop clause to my rules although it shouldn't be necessary).
> I can't share the affected KB, and unfortunately I was unable to reproduce the issue loop on a smaller example
> The affected rule looks like :
> {{rule "reset metric to max score when no more issues are present"
> //no-loop // TODO - no-loop TO BE REMOVED AS IT SHOULDN'T BE NECESSARY
> when
> Something($id:identity, $origin:origin)
> not Issue($id == identity, $origin == origin, category!="metrics")
> $scoring: Scoring(name == "performance", $id == identity, $origin == origin)
> then
> modify($scoring)
> { setValue(100.0); }
> end}}
> ----
> from https://issues.redhat.com/browse/DROOLS-4288 :
> When there is a version change in drools-compiler from `7.20.0.Final` to `7.21.0.Final` some rules are looping recursively.
> *Code in github:*
> [The working version|https://github.com/padippist/DroolsIssueReporting/tree/issue_v_7.20]
> [The recursively looping version|https://github.com/padippist/DroolsIssueReporting/tree/issue_v_7.21]
> [The change between working and looping version|https://github.com/padippist/DroolsIssueReporting/compare/issue_v...]
> *More details*
> When I fire a rule whose `then` part modifies a fact that is already checked in the `when` part:
> {code:java}
> rule "rule 1.1"
> when
> $sampleDomain: SampleDomain(instanceVariable2 == "Value of instance variable")
> then
> System.out.println("Rule 1.1 fired");
> modify($sampleDomain){
> setInstanceVariable1(3)
> }
> end
> {code}
> it doesn't loop recursively.
> But when I call another rule which call a static function from another class:
> {code:java}
> rule "rule 1.2"
> when
> $sampleDomain: SampleDomain(CoreUtils.anotherFunction())
> then
> System.out.println("Rule 1.2 fired");
> modify($sampleDomain){
> setInstanceVariable1(3)
> }
> end
> {code}
> it loops recursively.
> The class with static function is
> {code:java}
> import com.drool_issue.domain.SampleDomain;
> public class CoreUtils {
>
> public static boolean anotherFunction() {
> System.out.println("anotherFunction() inside CoreUtils");
> return true;
> }
>
> public static boolean anotherFunction(SampleDomain sampleDomain) {
> System.out.println("anotherFunction(SampleDomain sampleDomain) inside CoreUtils");
> return true;
> }
> }
> {code}
> My domain file is:
> {code:java}
> public class SampleDomain {
> private int instanceVariable1;
> private String instanceVariable2;
> private int instanceVariable3;
>
>
> public int getInstanceVariable1() {
> return instanceVariable1;
> }
> public void setInstanceVariable1(int instanceVariable1) {
> this.instanceVariable1 = instanceVariable1;
> }
> public String getInstanceVariable2() {
> return instanceVariable2;
> }
> public void setInstanceVariable2(String instanceVariable2) {
> this.instanceVariable2 = instanceVariable2;
> }
> public int getInstanceVariable3() {
> return instanceVariable3;
> }
> public void setInstanceVariable3(int instanceVariable3) {
> this.instanceVariable3 = instanceVariable3;
> }
>
>
> }
> {code}
> This is only caused after version change from `7.20.0.Final` to `7.21.0.Final`. Any guess on what the problem might be?
> When I further looked into the problem I saw this too.
> When we add two functions into the `SampleDomain` class ie
> {code:java}
> public boolean anotherFunction() {
> return true;
> }
>
> public boolean anotherFunction(SampleDomain sampleDomain) {
> return true;
> }
> {code}
> and use this in the rule like:
> {code:java}
> rule "rule 1.4"
> when
> $sampleDomain: SampleDomain(anotherFunction())
> then
> System.out.println("Rule 1.4 fired");
> modify($sampleDomain){
> setInstanceVariable1(3)
> }
> end
> {code}
> and
> {code:java}
> rule "rule 1.5"
> when
> $sampleDomain: SampleDomain(anotherFunction($sampleDomain))
> then
> System.out.println("Rule 1.5 fired");
> modify($sampleDomain){
> setInstanceVariable3(4)
> }
> end
> {code}
> these also loops recursively.
> *Code in github:*
> [The recursive looping when using non static methods|https://github.com/padippist/DroolsIssueReporting/tree/issue_v_7....]
> [The change between working and above version|https://github.com/padippist/DroolsIssueReporting/compare/issue_v...]
> Also when any of the static method is made non static then method from the domain class is called even though the static method is specified in the rule.
> *Code portions to be noted here are:*
> [Rule where static method is called.|https://github.com/padippist/DroolsIssueReporting/blob/bde2804b25...]
> [Another rule which also call the static method.|https://github.com/padippist/DroolsIssueReporting/blob/bde2804b25...]
> [The static access modifier removed from the functions which where previously static.|https://github.com/padippist/DroolsIssueReporting/compare/issue_v...]
> *Code in github:*
> [Weird behaviour when removing static modifier for the functions.|https://github.com/padippist/DroolsIssueReporting/tree/issue_v...]
> [The change between working and above version|https://github.com/padippist/DroolsIssueReporting/compare/issue_v...]
> *All this are caused in versions after `7.20.0.Final`, ie `7.21.0.Final`, `7.22.0.Final` and `7.23.0.Final`*
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 10 months
[JBoss JIRA] (DROOLS-4288) Infinite recursion in drools after version change from v7.20 to v7.21
by Mario Fusco (Jira)
[ https://issues.redhat.com/browse/DROOLS-4288?page=com.atlassian.jira.plug... ]
Mario Fusco commented on DROOLS-4288:
-------------------------------------
[~dacr] Sorry but I don't see any new attachment. Please attach your reproducer to DROOLS-4909
> Infinite recursion in drools after version change from v7.20 to v7.21
> ---------------------------------------------------------------------
>
> Key: DROOLS-4288
> URL: https://issues.redhat.com/browse/DROOLS-4288
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.21.0.Final, 7.22.0.Final, 7.23.0.Final
> Environment: Both Mac and Windows
> Reporter: Geogie Tom
> Assignee: Mario Fusco
> Priority: Major
> Fix For: 7.25.0.Final
>
> Attachments: Screen Shot 2019-07-10 at 3.53.10 PM.png, Screen Shot 2019-07-10 at 5.56.32 PM.png, Screen Shot 2019-07-10 at 5.59.28 PM.png, error.png, pojo.png, static.png, static_error.png
>
>
> When there is a version change in drools-compiler from `7.20.0.Final` to `7.21.0.Final` some rules are looping recursively.
> *Code in github:*
> [The working version|https://github.com/padippist/DroolsIssueReporting/tree/issue_v_7.20]
> [The recursively looping version|https://github.com/padippist/DroolsIssueReporting/tree/issue_v_7.21]
> [The change between working and looping version|https://github.com/padippist/DroolsIssueReporting/compare/issue_v...]
> *More details*
> When I fire a rule whose `then` part modifies a fact that is already checked in the `when` part:
> {code:java}
> rule "rule 1.1"
> when
> $sampleDomain: SampleDomain(instanceVariable2 == "Value of instance variable")
> then
> System.out.println("Rule 1.1 fired");
> modify($sampleDomain){
> setInstanceVariable1(3)
> }
> end
> {code}
> it doesn't loop recursively.
> But when I call another rule which call a static function from another class:
> {code:java}
> rule "rule 1.2"
> when
> $sampleDomain: SampleDomain(CoreUtils.anotherFunction())
> then
> System.out.println("Rule 1.2 fired");
> modify($sampleDomain){
> setInstanceVariable1(3)
> }
> end
> {code}
> it loops recursively.
> The class with static function is
> {code:java}
> import com.drool_issue.domain.SampleDomain;
> public class CoreUtils {
>
> public static boolean anotherFunction() {
> System.out.println("anotherFunction() inside CoreUtils");
> return true;
> }
>
> public static boolean anotherFunction(SampleDomain sampleDomain) {
> System.out.println("anotherFunction(SampleDomain sampleDomain) inside CoreUtils");
> return true;
> }
> }
> {code}
> My domain file is:
> {code:java}
> public class SampleDomain {
> private int instanceVariable1;
> private String instanceVariable2;
> private int instanceVariable3;
>
>
> public int getInstanceVariable1() {
> return instanceVariable1;
> }
> public void setInstanceVariable1(int instanceVariable1) {
> this.instanceVariable1 = instanceVariable1;
> }
> public String getInstanceVariable2() {
> return instanceVariable2;
> }
> public void setInstanceVariable2(String instanceVariable2) {
> this.instanceVariable2 = instanceVariable2;
> }
> public int getInstanceVariable3() {
> return instanceVariable3;
> }
> public void setInstanceVariable3(int instanceVariable3) {
> this.instanceVariable3 = instanceVariable3;
> }
>
>
> }
> {code}
> This is only caused after version change from `7.20.0.Final` to `7.21.0.Final`. Any guess on what the problem might be?
> When I further looked into the problem I saw this too.
> When we add two functions into the `SampleDomain` class ie
> {code:java}
> public boolean anotherFunction() {
> return true;
> }
>
> public boolean anotherFunction(SampleDomain sampleDomain) {
> return true;
> }
> {code}
> and use this in the rule like:
> {code:java}
> rule "rule 1.4"
> when
> $sampleDomain: SampleDomain(anotherFunction())
> then
> System.out.println("Rule 1.4 fired");
> modify($sampleDomain){
> setInstanceVariable1(3)
> }
> end
> {code}
> and
> {code:java}
> rule "rule 1.5"
> when
> $sampleDomain: SampleDomain(anotherFunction($sampleDomain))
> then
> System.out.println("Rule 1.5 fired");
> modify($sampleDomain){
> setInstanceVariable3(4)
> }
> end
> {code}
> these also loops recursively.
> *Code in github:*
> [The recursive looping when using non static methods|https://github.com/padippist/DroolsIssueReporting/tree/issue_v_7....]
> [The change between working and above version|https://github.com/padippist/DroolsIssueReporting/compare/issue_v...]
> Also when any of the static method is made non static then method from the domain class is called even though the static method is specified in the rule.
> *Code portions to be noted here are:*
> [Rule where static method is called.|https://github.com/padippist/DroolsIssueReporting/blob/bde2804b25...]
> [Another rule which also call the static method.|https://github.com/padippist/DroolsIssueReporting/blob/bde2804b25...]
> [The static access modifier removed from the functions which where previously static.|https://github.com/padippist/DroolsIssueReporting/compare/issue_v...]
> *Code in github:*
> [Weird behaviour when removing static modifier for the functions.|https://github.com/padippist/DroolsIssueReporting/tree/issue_v...]
> [The change between working and above version|https://github.com/padippist/DroolsIssueReporting/compare/issue_v...]
> *All this are caused in versions after `7.20.0.Final`, ie `7.21.0.Final`, `7.22.0.Final` and `7.23.0.Final`*
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 10 months
[JBoss JIRA] (DROOLS-4288) Infinite recursion in drools after version change from v7.20 to v7.21
by Crosson David (Jira)
[ https://issues.redhat.com/browse/DROOLS-4288?page=com.atlassian.jira.plug... ]
Crosson David commented on DROOLS-4288:
---------------------------------------
OK by adding enough complexity I was able to reproduce the issue see attached KB :)
> Infinite recursion in drools after version change from v7.20 to v7.21
> ---------------------------------------------------------------------
>
> Key: DROOLS-4288
> URL: https://issues.redhat.com/browse/DROOLS-4288
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.21.0.Final, 7.22.0.Final, 7.23.0.Final
> Environment: Both Mac and Windows
> Reporter: Geogie Tom
> Assignee: Mario Fusco
> Priority: Major
> Fix For: 7.25.0.Final
>
> Attachments: Screen Shot 2019-07-10 at 3.53.10 PM.png, Screen Shot 2019-07-10 at 5.56.32 PM.png, Screen Shot 2019-07-10 at 5.59.28 PM.png, error.png, pojo.png, static.png, static_error.png
>
>
> When there is a version change in drools-compiler from `7.20.0.Final` to `7.21.0.Final` some rules are looping recursively.
> *Code in github:*
> [The working version|https://github.com/padippist/DroolsIssueReporting/tree/issue_v_7.20]
> [The recursively looping version|https://github.com/padippist/DroolsIssueReporting/tree/issue_v_7.21]
> [The change between working and looping version|https://github.com/padippist/DroolsIssueReporting/compare/issue_v...]
> *More details*
> When I fire a rule whose `then` part modifies a fact that is already checked in the `when` part:
> {code:java}
> rule "rule 1.1"
> when
> $sampleDomain: SampleDomain(instanceVariable2 == "Value of instance variable")
> then
> System.out.println("Rule 1.1 fired");
> modify($sampleDomain){
> setInstanceVariable1(3)
> }
> end
> {code}
> it doesn't loop recursively.
> But when I call another rule which call a static function from another class:
> {code:java}
> rule "rule 1.2"
> when
> $sampleDomain: SampleDomain(CoreUtils.anotherFunction())
> then
> System.out.println("Rule 1.2 fired");
> modify($sampleDomain){
> setInstanceVariable1(3)
> }
> end
> {code}
> it loops recursively.
> The class with static function is
> {code:java}
> import com.drool_issue.domain.SampleDomain;
> public class CoreUtils {
>
> public static boolean anotherFunction() {
> System.out.println("anotherFunction() inside CoreUtils");
> return true;
> }
>
> public static boolean anotherFunction(SampleDomain sampleDomain) {
> System.out.println("anotherFunction(SampleDomain sampleDomain) inside CoreUtils");
> return true;
> }
> }
> {code}
> My domain file is:
> {code:java}
> public class SampleDomain {
> private int instanceVariable1;
> private String instanceVariable2;
> private int instanceVariable3;
>
>
> public int getInstanceVariable1() {
> return instanceVariable1;
> }
> public void setInstanceVariable1(int instanceVariable1) {
> this.instanceVariable1 = instanceVariable1;
> }
> public String getInstanceVariable2() {
> return instanceVariable2;
> }
> public void setInstanceVariable2(String instanceVariable2) {
> this.instanceVariable2 = instanceVariable2;
> }
> public int getInstanceVariable3() {
> return instanceVariable3;
> }
> public void setInstanceVariable3(int instanceVariable3) {
> this.instanceVariable3 = instanceVariable3;
> }
>
>
> }
> {code}
> This is only caused after version change from `7.20.0.Final` to `7.21.0.Final`. Any guess on what the problem might be?
> When I further looked into the problem I saw this too.
> When we add two functions into the `SampleDomain` class ie
> {code:java}
> public boolean anotherFunction() {
> return true;
> }
>
> public boolean anotherFunction(SampleDomain sampleDomain) {
> return true;
> }
> {code}
> and use this in the rule like:
> {code:java}
> rule "rule 1.4"
> when
> $sampleDomain: SampleDomain(anotherFunction())
> then
> System.out.println("Rule 1.4 fired");
> modify($sampleDomain){
> setInstanceVariable1(3)
> }
> end
> {code}
> and
> {code:java}
> rule "rule 1.5"
> when
> $sampleDomain: SampleDomain(anotherFunction($sampleDomain))
> then
> System.out.println("Rule 1.5 fired");
> modify($sampleDomain){
> setInstanceVariable3(4)
> }
> end
> {code}
> these also loops recursively.
> *Code in github:*
> [The recursive looping when using non static methods|https://github.com/padippist/DroolsIssueReporting/tree/issue_v_7....]
> [The change between working and above version|https://github.com/padippist/DroolsIssueReporting/compare/issue_v...]
> Also when any of the static method is made non static then method from the domain class is called even though the static method is specified in the rule.
> *Code portions to be noted here are:*
> [Rule where static method is called.|https://github.com/padippist/DroolsIssueReporting/blob/bde2804b25...]
> [Another rule which also call the static method.|https://github.com/padippist/DroolsIssueReporting/blob/bde2804b25...]
> [The static access modifier removed from the functions which where previously static.|https://github.com/padippist/DroolsIssueReporting/compare/issue_v...]
> *Code in github:*
> [Weird behaviour when removing static modifier for the functions.|https://github.com/padippist/DroolsIssueReporting/tree/issue_v...]
> [The change between working and above version|https://github.com/padippist/DroolsIssueReporting/compare/issue_v...]
> *All this are caused in versions after `7.20.0.Final`, ie `7.21.0.Final`, `7.22.0.Final` and `7.23.0.Final`*
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 10 months
[JBoss JIRA] (WFWIP-291) Log messages from io.smallrye.openapi don't have message ID
by Fabio Burzigotti (Jira)
[ https://issues.redhat.com/browse/WFWIP-291?page=com.atlassian.jira.plugin... ]
Fabio Burzigotti commented on WFWIP-291:
----------------------------------------
Hi [~pferraro], I do not agree on the argument that log message IDs are intended only for what relates to internationalization.
Those can in fact be used to perform automated log observation, statistics and so on.
These activities are then even more important in a cloud native/orchestrated environment, where systems and components do interoperation, and we know MicroProfile specs are definitely relating to this kind of environment.
So I am asking for you to keep this issue open as the topic is common to all MP specs we're integrating and there are similar issues that haven't been closed, see for instance https://issues.redhat.com/browse/WFWIP-280. My propposal is to re open it and wait until some common approach to the topic is decided.
[~rsvoboda] WDYT?
[~dlofthouse], thanks for your information.
Once again, I don't really think this is _just_ about internationalization.
That said, although I can I agree on your first argument:
{quote}
Additionally there is also a general issue in that we can not impose our own logging formats on third party projects pulled into WildFly.
If a third party project throws an Exception we can catch we may have an opportunity to catch and log with an ID or rethrow with an ID but we don't have options to intercept messages directly logged.
{quote}
... it's definitely good to know that SmallRye is being receptive to our feedback, as it could become important once Wildfly end users will notice that - for instance - they cannot search the Internet or the community/product docs for a message ID but for a variable text message.
Finally, I'd like to point out that in current MP OpenAPI SmallRye implementation, even WARNs and INFOs are not given a message ID:
{quote}
$ find . -name '*.*' -type f -print0 | xargs -0 grep --color -n -e 'LOG.warn'
./implementation/src/main/java/io/smallrye/openapi/runtime/scanner/ParameterProcessor.java:551: LOG.warnf("Matrix parameter references missing path segment: %s", segmentName);
{quote}
> Log messages from io.smallrye.openapi don't have message ID
> -----------------------------------------------------------
>
> Key: WFWIP-291
> URL: https://issues.redhat.com/browse/WFWIP-291
> Project: WildFly WIP
> Issue Type: Bug
> Components: MP OpenAPI
> Reporter: Fabio Burzigotti
> Assignee: Paul Ferraro
> Priority: Major
>
> Messages logged by io.smallrye.openapi don't have assigned ID:
> {code}
> 2020-01-05 16:58:49,225 DEBUG [io.smallrye.openapi.runtime.util.SchemaFactory] (MSC service thread 1-4) Processing a single @Schema annotation.
> 2020-01-05 16:58:49,225 DEBUG [io.smallrye.openapi.runtime.scanner.OpenApiAnnotationScanner] (MSC service thread 1-4) Processing a single @Response annotation.
> 2020-01-05 16:58:49,225 DEBUG [io.smallrye.openapi.runtime.scanner.OpenApiAnnotationScanner] (MSC service thread 1-4) Processing jax-rs method: {0}
> 2020-01-05 16:58:49,225 DEBUG [io.smallrye.openapi.runtime.scanner.OpenApiDataObjectScanner] (MSC service thread 1-4) Starting processing with root: java.lang.String
> {code}
> A search in SmallRye implementation seems to show that IDs are not used even when level is WARN:
> {code}
> $ find . -name '*.*' -type f -print0 | xargs -0 grep --color -n -e 'LOG.warn'
> ./implementation/src/main/java/io/smallrye/openapi/runtime/scanner/ParameterProcessor.java:551: LOG.warnf("Matrix parameter references missing path segment: %s", segmentName);
> ./implementation/src/main/java/io/smallrye/openapi/runtime/scanner/ParameterProcessor.java:1147: LOG.warnf("Value '%s' is not a valid %s default", stringValue, primitive.name().toLowerCase());
> {code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 10 months
[JBoss JIRA] (DROOLS-4288) Infinite recursion in drools after version change from v7.20 to v7.21
by Mario Fusco (Jira)
[ https://issues.redhat.com/browse/DROOLS-4288?page=com.atlassian.jira.plug... ]
Mario Fusco commented on DROOLS-4288:
-------------------------------------
Just a wild guess, is it possible that you have 2 rules calling each other instead? As soon as you have a reproducer please attach it to DROOLS-4909 and leave this ticket closed. Thanks again.
> Infinite recursion in drools after version change from v7.20 to v7.21
> ---------------------------------------------------------------------
>
> Key: DROOLS-4288
> URL: https://issues.redhat.com/browse/DROOLS-4288
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.21.0.Final, 7.22.0.Final, 7.23.0.Final
> Environment: Both Mac and Windows
> Reporter: Geogie Tom
> Assignee: Mario Fusco
> Priority: Major
> Fix For: 7.25.0.Final
>
> Attachments: Screen Shot 2019-07-10 at 3.53.10 PM.png, Screen Shot 2019-07-10 at 5.56.32 PM.png, Screen Shot 2019-07-10 at 5.59.28 PM.png, error.png, pojo.png, static.png, static_error.png
>
>
> When there is a version change in drools-compiler from `7.20.0.Final` to `7.21.0.Final` some rules are looping recursively.
> *Code in github:*
> [The working version|https://github.com/padippist/DroolsIssueReporting/tree/issue_v_7.20]
> [The recursively looping version|https://github.com/padippist/DroolsIssueReporting/tree/issue_v_7.21]
> [The change between working and looping version|https://github.com/padippist/DroolsIssueReporting/compare/issue_v...]
> *More details*
> When I fire a rule whose `then` part modifies a fact that is already checked in the `when` part:
> {code:java}
> rule "rule 1.1"
> when
> $sampleDomain: SampleDomain(instanceVariable2 == "Value of instance variable")
> then
> System.out.println("Rule 1.1 fired");
> modify($sampleDomain){
> setInstanceVariable1(3)
> }
> end
> {code}
> it doesn't loop recursively.
> But when I call another rule which call a static function from another class:
> {code:java}
> rule "rule 1.2"
> when
> $sampleDomain: SampleDomain(CoreUtils.anotherFunction())
> then
> System.out.println("Rule 1.2 fired");
> modify($sampleDomain){
> setInstanceVariable1(3)
> }
> end
> {code}
> it loops recursively.
> The class with static function is
> {code:java}
> import com.drool_issue.domain.SampleDomain;
> public class CoreUtils {
>
> public static boolean anotherFunction() {
> System.out.println("anotherFunction() inside CoreUtils");
> return true;
> }
>
> public static boolean anotherFunction(SampleDomain sampleDomain) {
> System.out.println("anotherFunction(SampleDomain sampleDomain) inside CoreUtils");
> return true;
> }
> }
> {code}
> My domain file is:
> {code:java}
> public class SampleDomain {
> private int instanceVariable1;
> private String instanceVariable2;
> private int instanceVariable3;
>
>
> public int getInstanceVariable1() {
> return instanceVariable1;
> }
> public void setInstanceVariable1(int instanceVariable1) {
> this.instanceVariable1 = instanceVariable1;
> }
> public String getInstanceVariable2() {
> return instanceVariable2;
> }
> public void setInstanceVariable2(String instanceVariable2) {
> this.instanceVariable2 = instanceVariable2;
> }
> public int getInstanceVariable3() {
> return instanceVariable3;
> }
> public void setInstanceVariable3(int instanceVariable3) {
> this.instanceVariable3 = instanceVariable3;
> }
>
>
> }
> {code}
> This is only caused after version change from `7.20.0.Final` to `7.21.0.Final`. Any guess on what the problem might be?
> When I further looked into the problem I saw this too.
> When we add two functions into the `SampleDomain` class ie
> {code:java}
> public boolean anotherFunction() {
> return true;
> }
>
> public boolean anotherFunction(SampleDomain sampleDomain) {
> return true;
> }
> {code}
> and use this in the rule like:
> {code:java}
> rule "rule 1.4"
> when
> $sampleDomain: SampleDomain(anotherFunction())
> then
> System.out.println("Rule 1.4 fired");
> modify($sampleDomain){
> setInstanceVariable1(3)
> }
> end
> {code}
> and
> {code:java}
> rule "rule 1.5"
> when
> $sampleDomain: SampleDomain(anotherFunction($sampleDomain))
> then
> System.out.println("Rule 1.5 fired");
> modify($sampleDomain){
> setInstanceVariable3(4)
> }
> end
> {code}
> these also loops recursively.
> *Code in github:*
> [The recursive looping when using non static methods|https://github.com/padippist/DroolsIssueReporting/tree/issue_v_7....]
> [The change between working and above version|https://github.com/padippist/DroolsIssueReporting/compare/issue_v...]
> Also when any of the static method is made non static then method from the domain class is called even though the static method is specified in the rule.
> *Code portions to be noted here are:*
> [Rule where static method is called.|https://github.com/padippist/DroolsIssueReporting/blob/bde2804b25...]
> [Another rule which also call the static method.|https://github.com/padippist/DroolsIssueReporting/blob/bde2804b25...]
> [The static access modifier removed from the functions which where previously static.|https://github.com/padippist/DroolsIssueReporting/compare/issue_v...]
> *Code in github:*
> [Weird behaviour when removing static modifier for the functions.|https://github.com/padippist/DroolsIssueReporting/tree/issue_v...]
> [The change between working and above version|https://github.com/padippist/DroolsIssueReporting/compare/issue_v...]
> *All this are caused in versions after `7.20.0.Final`, ie `7.21.0.Final`, `7.22.0.Final` and `7.23.0.Final`*
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 10 months