[jboss-jira] [JBoss JIRA] (DROOLS-3325) Insert operation on a disposed Kie session from session pool should fail

Mario Fusco (Jira) issues at jboss.org
Tue Nov 20 08:22:00 EST 2018


     [ https://issues.jboss.org/browse/DROOLS-3325?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mario Fusco resolved DROOLS-3325.
---------------------------------
    Resolution: Won't Fix


What's happening there is the following

* one thread calls dispose and then gets swapped out
*  the dispose both sets the ksession as not alive and put it back into the pool
* another thread take the session back from the pool and set it alive
* at that point the 1st thread is awaken up and performs the insert on a ksession that is alive again

We decided to not fix this use case because we don't want to limit the possibility of using a session from multiple thread. Another option would have been to set up a sort of transaction system, so that with newKieSession you will begin one transaction and with dispose you will end it. Also in this second case (even not considering the performance implications) this means that you should receive a transaction token and pass that token around for every operation. In other words we'd need to totally change the API of the KieSession by adding this transaction token argument to each and every method and this is clearly not feasible.

> Insert operation on a disposed Kie session from session pool should fail
> ------------------------------------------------------------------------
>
>                 Key: DROOLS-3325
>                 URL: https://issues.jboss.org/browse/DROOLS-3325
>             Project: Drools
>          Issue Type: Bug
>          Components: core engine
>    Affects Versions: 7.14.0.Final
>            Reporter: Tibor Zimányi
>            Assignee: Mario Fusco
>            Priority: Major
>
> When running test [1] SessionsPoolTest.testKieSessionsPoolInMultithreadEnv in a loop (it helps to raise the number of threads to 100), it fails, because the insert() operation that is done after session dispose ends without an exception. Stacktrace is here [2].
> [1] https://github.com/kiegroup/drools/blob/83f0751f5ebf7bc75a6431bc00b1b82232b75206/drools-compiler/src/test/java/org/drools/compiler/integrationtests/session/SessionsPoolTest.java#L86
> [2] https://gist.github.com/baldimir/7aaab506c0cd8c273097d71f847d8631



--
This message was sent by Atlassian Jira
(v7.12.1#712002)



More information about the jboss-jira mailing list