Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-3103

"A and not(B after A)" type rules don't fire when session clock has negative values (pre Unix epoch)

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    Description

      See JBRULES-3100 for the gory details. The implementation described there causes two bugs, so THIS IS NOT A DUPLICATE of JBRULES-3100. Rather, the bugs are related, and because it is possible to fix one without the other, it makes sense to track both bugs explicitly, so that the developers can ensure that both bugs get fixed. The summary of this issue also conveys to users that this particular bug has already been reported.

      So, this bug prevents rules of the form

      $a: A()
      not(B(this after $a))

      or "A and not(B after A)" in pseudocode, from firing when they should if the session clock has a negative value, say during a simulation or if the system clock is turned back pre Unix epoch. This is confirmed for the pseudo clock, and I believe the real-time clock is equally affected. The root of the problem is that "A and not(B after A)" type rules get a duration of Long.MAX_VALUE assigned. When that gets added to a non-positive current time, it results in a very large positive number for the trigger time, which will never be reached by the session clock, preventing the rule from ever firing.

      The fix is probably to add the activation for such a rule to the agenda immediately, rather than schedule it for adding. This would yield the same behavior as when you compare the timestamps explicitly. For now, comparing timestamps explicitly instead of using "after" is a workaround for this bug.

      Attachments

        Issue Links

          Activity

            People

              etirelli@redhat.com Edson Tirelli
              rcalmbac Richard Calmbach (Inactive)
              Archiver:
              rhn-support-ceverson Clark Everson

              Dates

                Created:
                Updated:
                Resolved:
                Archived:

                PagerDuty