Bug 1279402 - KieRepository is not completely thread safe
Summary: KieRepository is not completely thread safe
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: BRE
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
high
low
Target Milestone: ---
: ---
Assignee: Mario Fusco
QA Contact: Tibor Zimanyi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-09 11:39 UTC by Tibor Zimanyi
Modified: 2015-11-10 10:29 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-11-10 10:28:49 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1273368 0 high CLOSED building large project multiple times with incremented versionId would consume OldGen heap gradually 2021-02-22 00:41:40 UTC
Red Hat Issue Tracker DROOLS-923 0 Major Resolved KieRepository is not thread safe 2016-04-19 08:28:02 UTC

Description Tibor Zimanyi 2015-11-09 11:39:23 UTC
Description of problem:

KieRepository is not completely thread safe, so when many threads concurrently add and remove KieModules, this can lead to a NPE.


Version-Release number of selected component (if applicable): 6.2.0.ER5


How reproducible:

Run IncrementalCompilationTest.testConcurrentKJarDeployment test method [1] with raised number of threads (e.g. 200). 

[1] https://github.com/droolsjbpm/drools/blob/a53b630f21ff8ab65de8f22d28611160ba5936d3/drools-compiler/src/test/java/org/drools/compiler/integrationtests/IncrementalCompilationTest.java#L1913

Actual results: 

The test fails. 


Expected results: 

The test passes.

Comment 2 JBoss JIRA Server 2015-11-09 11:40:58 UTC
Tibor Zimányi <tzimanyi> updated the status of jira DROOLS-923 to Reopened

Comment 3 Mario Fusco 2015-11-10 10:28:49 UTC
The NullPointerException reported by Tibor is not caused by a concurrency issue, but by the LRU cache that we introduced to workaround this other problem https://bugzilla.redhat.com/show_bug.cgi?id=1273368

That cache by default has a max size of 100 items https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/main/java/org/drools/compiler/kie/builder/impl/KieRepositoryImpl.java#L257 and increasing this size makes the NPE to disappear.

Comment 4 JBoss JIRA Server 2015-11-10 10:29:27 UTC
Mario Fusco <mario.fusco> updated the status of jira DROOLS-923 to Resolved


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