Details
-
Bug
-
Resolution: Done
-
Critical
-
5.2.0.Final
-
None
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
- is related to
-
JBRULES-3100 Long.MAX_VALUE duration for "A and not(B after A)" type rules causes invalid session clock time in rule RHS when running with pseudo clock
- Closed