Bug 1185691

Summary: NullPointerException or IllegalStateException occurs when session.execute() are called concurrently
Product: [Retired] JBoss BRMS Platform 6 Reporter: Hisao Furuichi <hfuruich>
Component: BREAssignee: Mario Fusco <mfusco>
Status: CLOSED EOL QA Contact: Marek Winkler <mwinkler>
Severity: urgent Docs Contact: Dawn Eisner <deisner>
Priority: urgent    
Version: 6.0.3CC: alazarot, kverlaen, mbaluch, mfusco
Target Milestone: ER5   
Target Release: 6.1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1195144 (view as bug list) Environment:
Last Closed: 2020-03-27 20:00:46 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:
Bug Depends On:    
Bug Blocks: 1195144    
Attachments:
Description Flags
reproducer
none
fixed class none

Description Hisao Furuichi 2015-01-26 01:10:20 UTC
Created attachment 984087 [details]
reproducer

Description of problem:
If session.execute is called concurrently, NullpinterException or IllegalStateExeition occurs. 


Steps to Reproduce:
1. Download and import Drools6ReoccurNPEProject.zip to JBDS
2. Fix jars and JVM option(like: -Xms1303m -Xmx1303m)
3. Run com.sample.DroolsTest

Actual results:
One of following types of Exception occurs.
===
java.lang.IllegalMonitorStateException
	at java.util.concurrent.locks.ReentrantLock$Sync.tryRelease(ReentrantLock.java:155)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.release(AbstractQueuedSynchronizer.java:1260)
	at java.util.concurrent.locks.ReentrantLock.unlock(ReentrantLock.java:460)
	at org.drools.core.common.AbstractWorkingMemory.endBatchExecution(AbstractWorkingMemory.java:1753)
	at org.drools.core.impl.StatelessKnowledgeSessionImpl.execute(StatelessKnowledgeSessionImpl.java:381)
	at com.sample.RuleTestThread.execRun(RuleTestThread.java:39)
	at com.sample.RuleTestThread.run(RuleTestThread.java:23)
===

===
java.lang.NullPointerException
	at org.drools.core.impl.StatelessKnowledgeSessionImpl.execute(StatelessKnowledgeSessionImpl.java:381)
	at com.sample.RuleTestThread.execRun(RuleTestThread.java:39)
	at com.sample.RuleTestThread.run(RuleTestThread.java:23)
===

Expected results:
The program can run without any Exception


Additional info:
Our customer shares fixed StatelessKnowledgeSessionImpl.java which is the one in BRMS 6.0.3. Please check their modification. The fixed class is attached as StatelessKnowledgeSessionImpl.CHAGEDraft.java

Comment 1 Hisao Furuichi 2015-01-26 01:11:01 UTC
Created attachment 984088 [details]
fixed class

Comment 3 Mario Fusco 2015-01-28 13:56:03 UTC
Fixed by https://github.com/droolsjbpm/drools/commit/2bd608bb5

Comment 4 Marek Winkler 2015-02-24 15:45:06 UTC
Verified in BRMS 6.1.0 ER5.