Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-1229

Event expiration cycles itself when expiring events from large set of same rules with "after" operator

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.0.0.Beta2
    • 6.4.0.Final
    • core engine
    • None
    • NEW
    • NEW

      When using many same rules with after, event expiration cycles itself.

      Using 64 copies of this rule [1], code here [2] cycles itself. I think it is because when it searches through child and peer tuples, it can find already expired tuple and it tries to expire it again. So the problem is either there or in that there is some cycle in tuple chain.

      [1]
      import org.drools.testcoverage.common.model.EventA;
      import org.drools.testcoverage.common.model.EventB;
      declare org.drools.testcoverage.common.model.EventA @role( event ) @duration(duration) end declare org.drools.testcoverage.common.model.EventB @role( event ) @duration(duration) end rule R0 when
      $event1: org.drools.testcoverage.common.model.EventA()
      $event2: org.drools.testcoverage.common.model.EventB(this != $event1, this after [1,10] $event1)
      then end

      [2] https://github.com/droolsjbpm/drools/blob/master/drools-core/src/main/java/org/drools/core/impl/StatefulKnowledgeSessionImpl.java#L1820

      I will make a PR with reproducer and proposed fix for this.

              mfusco@redhat.com Mario Fusco
              tzimanyi@redhat.com Tibor Zimányi
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: