]
Edson Tirelli reassigned DROOLS-2542:
-------------------------------------
Assignee: Mario Fusco (was: Edson Tirelli)
KieHelper.getKieContainer() is not thread-safe
----------------------------------------------
Key: DROOLS-2542
URL:
https://issues.jboss.org/browse/DROOLS-2542
Project: Drools
Issue Type: Bug
Affects Versions: 7.7.0.Final
Reporter: Nils Meyer
Assignee: Mario Fusco
Calling org.kie.api.KieServices.newKieContainer(ReleaseId, ClassLoader), in the way it is
done in org.kie.internal.utils.KieHelper.getKieContainer() can cause problems in
situations where concurrent threads are in action. newKieContainer reads the latest
KieModule from the repository that was written by a builder. If multiple builders for
different rules are running in parallel, it's not predictable, which rules will be
used when creating a new session (see my sample below).
I'm aware that I can work around this issue by using ReleaseIds, but nevertheless
this behavior is cumbersome if you'd like to understand the relation between the
KieFileSystem and the KieContainer in org.kie.internal.utils.KieHelper.getKieContainer()