Bug 724224 (BRMS-168)

Summary: Race conditions in AbstractRuleBase
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: nwallace <nwallace>
Component: unspecifiedAssignee: Edson Tirelli <ed.tirelli>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: high    
Version: unspecified   
Target Milestone: ---   
Target Release: 5.0.1   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/BRMS-168
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Windows, Drools CR1
Last Closed: 2009-09-01 12:23:48 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:

Description nwallace 2009-07-07 14:27:52 UTC
Date of First Response: 2009-09-10 01:08:48
securitylevel_name: Public

ReteooRuleBaseMultiThreadedTest is failing because of race conditions in AbstractRuleBase

java.lang.NullPointerException
	at org.drools.common.AbstractRuleBase.lock(AbstractRuleBase.java:408)
	at org.drools.common.AbstractRuleBase.removePackage(AbstractRuleBase.java:655)
	at org.drools.reteoo.ReteooRuleBaseMultiThreadedTest$PackageModifier.doOperation(ReteooRuleBaseMultiThreadedTest.java:143)
	at org.drools.reteoo.ReteooRuleBaseMultiThreadedTest$BlockedThread.run(ReteooRuleBaseMultiThreadedTest.java:121)

junit.framework.AssertionFailedError: Exception in modifier thread expected:<false> but was:<true>
	at org.drools.reteoo.ReteooRuleBaseMultiThreadedTest.testNewSessionWhileModifyingRuleBase(ReteooRuleBaseMultiThreadedTest.java:80)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)

Comment 1 nwallace 2009-07-07 14:29:15 UTC
Link: Added: This issue is related to JBRULES-2029


Comment 2 nwallace 2009-09-01 12:23:48 UTC
Fix in place.

Comment 3 David Le Sage 2009-09-10 05:08:48 UTC
For documenting this in the Release Notes, can you please confirm the following and fill in the missing information. Dot point explanations are fine:

The CAUSE (what was actually broken)
 * the ReteooRuleBaseMultiThreadedTest in the AbstractRuleBase was failing due to a Race Condition problem

CONSEQUENCES of the bug (how it impacts users.)
 * A null pointer exception would occur.

The FIX (what was changed to eliminate this bug) and 
 *

RESULTS of the fix (what now happens for users.)
 * 


Comment 4 David Le Sage 2009-09-23 05:36:44 UTC
We are still awaiting the outstanding information for the Release Notes on this one.  Please provide it as soon as possible. Thanks.

Comment 5 Edson Tirelli 2009-09-23 18:32:02 UTC
The CAUSE (what was actually broken)
 * the ReteooRuleBaseMultiThreadedTest in the AbstractRuleBase was failing due to a Race Condition problem

CONSEQUENCES of the bug (how it impacts users.)
 * A null pointer exception would occur.

The FIX (what was changed to eliminate this bug) and
 * Fix lock management in the AbstractRuleBase class to avoid the race condition.

RESULTS of the fix (what now happens for users.)
 * No more exceptions due to race condition.

Comment 6 Dana Mison 2009-10-05 04:33:07 UTC
added to the 5.0.CP01 release notes as resolved:

JBRULES-2029
A race condition in the class AbstractRuleBase could cause a null pointer exception.  The lock management in AbstractRuleBase has been updated to prevent this race condition occurring.