Red Hat Bugzilla – Bug 1279402
KieRepository is not completely thread safe
Last modified: 2015-11-10 05:29:27 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
Run IncrementalCompilationTest.testConcurrentKJarDeployment test method  with raised number of threads (e.g. 200).
The test fails.
The test passes.
Tibor Zimányi <firstname.lastname@example.org> updated the status of jira DROOLS-923 to Reopened
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.
Mario Fusco <email@example.com> updated the status of jira DROOLS-923 to Resolved