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

Already expired events entering session remain forever in working memory

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Done
    • 7.60.0.Final
    • None
    • core engine
    • None

    Description

      The fixes for
      DROOLS-4660 prevent expiration of an event if it is still reference…
      DROOLS-4577 propagate updates even for expired events

      indirectly lead to a new issue where an expired fact can remain forever in working memory. One case we could demonstrate is when an expired event enters the session, match with a rule R1 which applies a modify in RHS (thus leading to add the fact handle in ObjectStore) and is also a right tuple in R2.

      Besides, This issue can be especially harmful when we use serialization feature of kieSession as it leads to "resurrect" expired event, without any security as there is no expiration job associated with them, and no re-scheduling of expiration in PropationEntry#Insert due to the non null context.getReaderContext() during deserialization https://github.com/kiegroup/drools/blob/8f61e6ff879d8b6ab792621e6aff356655acba05/drools-core/src/main/java/org/drools/core/phreak/PropagationEntry.java#L180

      In drools 6.5.0.Final such expired event will not survive till the next advance in pseudo-clock. In drools 7, such fact should have a chance to match (as it is stated in the drools principles), but imo only during one full inference cycle.

      I'll shortly provide a PR which fix this issue,

      I also provide a reproducer for this issue

      Attachments

        Issue Links

          Activity

            People

              mfusco@redhat.com Mario Fusco
              slem1 Sylvain Lemoine (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: