Uploaded image for project: 'Red Hat Process Automation Manager'
  1. Red Hat Process Automation Manager
  2. RHPAM-1852

Livelock in PseudoClockScheduler

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Minor
    • 7.3.0.GA
    • 7.2.0.GA
    • BRE
    • None

    Description

      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

      Attachments

        Issue Links

          Activity

            People

              tzimanyi@redhat.com Tibor Zimányi
              tzimanyi@redhat.com Tibor Zimányi
              Jiri Petrlik Jiri Petrlik
              Jiri Petrlik Jiri Petrlik
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: