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

Incorrect expiration of events when using inheritance.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 6.4.0.Beta1
    • 6.3.0.Final
    • core engine
    • None
    • Mac OS X 10.11.1, Oracle Hotspot 1.7.0_79, Drools 6.4.0-SNAPSHOT

      When I define 2 events with different @expires configurations (e.g. event-type-1 with 10s, the event-type-2 with 100d), and the event-type-2 is a subclass of event-type-1, the instances of event-type-2 are expired using the configuration of event-type-1.

      So even though instances of event-type-2 have been configured to expire after a 100 days, they expire after 10 seconds.

      What happens is that there are 2 WorkingMemoryReteExpireAction jobs scheduled for each insert, one with the scheduling of event-type-1, and one with the scheduling of event-type-2. This is probably due to the fact that the inserted event matches 2 patterns, one for event-type-1 (its superclass) and one for event-type-2 (its actual class). When the WorkingMemoryReteExpireAction with scheduling of event-type-1 runs, the event is expired.

      Reproducer can be found here: https://github.com/DuncanDoyle/drools-event-expiration-issue . Just run "mvn clean test" on that project.

              mfusco@redhat.com Mario Fusco
              rhn-gps-ddoyle Duncan Doyle (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: