Bug 981270 - Rule including an interval timer with delay does not fire in fireUntilHalt() mode
Rule including an interval timer with delay does not fire in fireUntilHalt() ...
Status: CLOSED CURRENTRELEASE
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: BRE (Show other bugs)
6.0.0
Unspecified Unspecified
unspecified Severity high
: ER4
: 6.0.0
Assigned To: Mario Fusco
Tomas David
: Regression
Depends On:
Blocks: 978979
  Show dependency treegraph
 
Reported: 2013-07-04 06:53 EDT by Marek Winkler
Modified: 2014-08-06 16:16 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-08-06 16:16:02 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Marek Winkler 2013-07-04 06:53:19 EDT
When a rule defines an interval timer with non-zero delay, it does not fire. The rule uses accumulate and a time window and engine runs in fireUntilHalt() mode in a separate thread. I could not reproduce the problem when creating only a simple rule (without accumulate and time window).

It seems that using real-time or pseudo clock does not have effect on the issue. 

Please see the attached pull request for reproducer and more details. The test case is a bit artificial, but it passes with Beta3.

The rule looks as follows:

rule "Number of metadata events in the last 10 seconds"
timer (int: 1s 10s)
// timer (int: 0s 10s) - passes
when
    String( this == "events_inserted" )
    $clock: SessionClock()
    $count: Number() from accumulate( $event: MetadataEvent() over window:time(10s),  count( $event ) )
then
    System.out.println(new Date($clock.getCurrentTime()) + ": Events count: " + $count);
    countResult.add($count);
end


Version-Release number of selected component (if applicable):

Drools 6.0.0-SNAPSHOT
Drools 6.0.0.Beta4

This worked in 6.0.0.Beta3, marking as regression.


How reproducible:

Please run CepFireUntilHaltTimerTest from the pull request (to be attached soon).


Actual results:

The rule in the test does not fire.


Expected results:

The rule should fire making the test pass.
Comment 1 Marek Winkler 2013-07-04 06:55:38 EDT
Pull request with reproducer: https://github.com/droolsjbpm/drools/pull/220
Comment 2 Mario Fusco 2013-09-03 11:50:00 EDT
I fixed the rule scheduling when the interval timer is used. However the test needs a further sleep here

https://github.com/droolsjbpm/drools/commit/3cf78d69d#L0R120

to make sure that all the facts insertions are processed before to move the clock forward. Anyway this should be necessary only when using the PseudoClock.

This fix is NOT included in the CR3, but will be part of the CR4.
Comment 6 Tomas David 2013-10-14 09:15:53 EDT
Verified on BRMS 6.0.0.ER4.

Note You need to log in before you can comment on or make changes to this bug.