Bug 1185691 - NullPointerException or IllegalStateException occurs when session.execute() are called concurrently
Summary: NullPointerException or IllegalStateException occurs when session.execute() a...
Keywords:
Status: CLOSED EOL
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: BRE
Version: 6.0.3
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ER5
: 6.1.0
Assignee: Mario Fusco
QA Contact: Marek Winkler
Dawn Eisner
URL:
Whiteboard:
Depends On:
Blocks: 1195144
TreeView+ depends on / blocked
 
Reported: 2015-01-26 01:10 UTC by Hisao Furuichi
Modified: 2020-03-27 20:00 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1195144 (view as bug list)
Environment:
Last Closed: 2020-03-27 20:00:46 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
reproducer (9.12 KB, application/zip)
2015-01-26 01:10 UTC, Hisao Furuichi
no flags Details
fixed class (21.83 KB, text/x-csrc)
2015-01-26 01:11 UTC, Hisao Furuichi
no flags Details

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.


Note You need to log in before you can comment on or make changes to this bug.