Bug 1279402 - KieRepository is not completely thread safe
KieRepository is not completely thread safe
Status: CLOSED NOTABUG
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: BRE (Show other bugs)
6.2.0
Unspecified Unspecified
high Severity low
: ---
: ---
Assigned To: Mario Fusco
Tibor Zimanyi
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-09 06:39 EST by Tibor Zimanyi
Modified: 2015-11-10 05:29 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-11-10 05:28:49 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Bugzilla 1273368 None None None Never
JBoss Issue Tracker DROOLS-923 Major Resolved KieRepository is not thread safe 2016-04-19 04:28 EDT

  None (edit)
Description Tibor Zimanyi 2015-11-09 06:39:23 EST
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 06:40:58 EST
Tibor Zimányi <tzimanyi@redhat.com> updated the status of jira DROOLS-923 to Reopened
Comment 3 Mario Fusco 2015-11-10 05:28:49 EST
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 05:29:27 EST
Mario Fusco <mario.fusco@gmail.com> 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.