Bug 1199201

Summary: NPE when incremental compilation removes a rule in stream mode
Product: [Retired] JBoss BRMS Platform 6 Reporter: Mario Fusco <mfusco>
Component: BREAssignee: Mario Fusco <mfusco>
Status: CLOSED EOL QA Contact: Marek Winkler <mwinkler>
Severity: high Docs Contact:
Priority: high    
Version: 6.2.0CC: etirelli, rrajasek
Target Milestone: CR1   
Target Release: 6.1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-27 18:36:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mario Fusco 2015-03-05 15:52:37 UTC
When in stream mode a rule is removed by an incremental compilation, the right tuples in the stream queues of the memories of the correspondingly removed beta nodes don't get unlinked. This causes the following NPE when you try to programmatically remove from the session the fact to which one of those right tuple was referring to:

java.lang.NullPointerException
	at org.drools.core.reteoo.NotNode.doDeleteRightTuple(NotNode.java:184)
	at org.drools.core.reteoo.NotNode.retractRightTuple(NotNode.java:172)
	at org.drools.core.reteoo.ObjectTypeNode.doRetractObject(ObjectTypeNode.java:347)
	at org.drools.core.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:339)
	at org.drools.core.reteoo.EntryPointNode.retractObject(EntryPointNode.java:392)
	at org.drools.core.common.NamedEntryPoint.delete(NamedEntryPoint.java:556)
	at org.drools.core.common.NamedEntryPoint.delete(NamedEntryPoint.java:519)
	at org.drools.core.impl.StatefulKnowledgeSessionImpl.delete(StatefulKnowledgeSessionImpl.java:1530)
	at org.drools.core.impl.StatefulKnowledgeSessionImpl.delete(StatefulKnowledgeSessionImpl.java:1521)

Comment 1 Mario Fusco 2015-03-05 15:53:28 UTC
Fixed by https://github.com/droolsjbpm/drools/commit/730120030

Comment 3 Mario Fusco 2015-03-10 18:44:02 UTC
Cherry-picked to 6.2.x branch with https://github.com/droolsjbpm/drools/commit/64b0db977

Comment 4 Marek Winkler 2015-03-26 15:39:05 UTC
Verified in BRMS 6.1.0 CR1.

Comment 5 JBoss JIRA Server 2015-07-01 18:12:07 UTC
Mario Fusco <mario.fusco> updated the status of jira DROOLS-731 to Resolved