[jboss-jira] [JBoss JIRA] (DROOLS-3573) Livelock in PseudoClockScheduler

Tibor Zimányi (Jira) issues at jboss.org
Tue Jan 29 11:15:01 EST 2019


Tibor Zimányi created DROOLS-3573:
-------------------------------------

             Summary: Livelock in PseudoClockScheduler
                 Key: DROOLS-3573
                 URL: https://issues.jboss.org/browse/DROOLS-3573
             Project: Drools
          Issue Type: Enhancement
          Components: core engine
    Affects Versions: 7.17.0.Final
            Reporter: Tibor Zimányi
            Assignee: Tibor Zimányi


When running test with pseudo clock and fireUntilHalt, it could end up in a livelock, where a while loop never ends [1]. The main problem in [1] is the isCancel() if statement. Current synchronization doesn't block cancelling the item during ongoing runCallBacksAndIncreaseTimer method call with [2]. That causes a livelock, because new item is not read in the loop, therefore it iterates over the same item again and again. This can be tested by running CepEspTest.testEventExpirationInSlidingWindow [3] more times in a row till it fails (it always fails after some time). 

I will create a PR for this. 

[1] https://github.com/kiegroup/drools/blob/04d58e7714844e73f68e6143e235bb55791c9888/drools-core/src/main/java/org/drools/core/time/impl/PseudoClockScheduler.java#L204
[2] https://github.com/kiegroup/drools/blob/04d58e7714844e73f68e6143e235bb55791c9888/drools-core/src/main/java/org/drools/core/time/impl/PseudoClockScheduler.java#L147
[3] https://github.com/kiegroup/drools/blob/2bf3c13de000864e7c45b9fd008af2f542674592/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/compiler/integrationtests/CepEspTest.java#L1933



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



More information about the jboss-jira mailing list