Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1059372 - NPE in a timer node when a left tuple get activated immediately and then rescheduled in the same node evaluation
Summary: NPE in a timer node when a left tuple get activated immediately and then resc...
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: BRE
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: ER1
: 6.0.1
Assignee: Mario Fusco
QA Contact: Marek Winkler
Depends On:
TreeView+ depends on / blocked
Reported: 2014-01-29 18:00 UTC by Mario Fusco
Modified: 2014-08-06 19:58 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-08-06 19:58:23 UTC
Type: Bug

Attachments (Terms of Use)

Description Mario Fusco 2014-01-29 18:00:57 UTC
When a left tuple get activated immediately and then rescheduled in the same evaluation loop fo a timer node the following Exception is thrown:

	at org.drools.core.phreak.PhreakTimerNode.doPropagateChildLeftTuple(
	at org.drools.core.phreak.PhreakTimerNode.doPropagateChildLeftTuples(
	at org.drools.core.phreak.PhreakTimerNode.doNode(
	at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(
	at org.drools.core.phreak.RuleNetworkEvaluator.outerEval(
	at org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(
	at org.drools.core.phreak.RuleExecutor.reEvaluateNetwork(
	at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(
	at org.drools.core.common.DefaultAgenda.fireNextItem(
	at org.drools.core.common.DefaultAgenda.fireAllRules(
	at org.drools.core.common.AbstractWorkingMemory.fireAllRules(
	at org.drools.core.common.AbstractWorkingMemory.fireAllRules(
	at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(
	at org.drools.compiler.integrationtests.Misc2Test.testCronFire(

The following test case reproduces the problem:

    public void testCronFire() throws InterruptedException {
        String drl = "package test.drools\n" +
                     "rule TestRule " +
                     "  timer (cron:* * * * * ?) " +
                     "when\n" +
                     "    String() " +
                     "    Integer() " +
                     "then\n" +

        KnowledgeBase kbase = loadKnowledgeBaseFromString(drl);
        StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();

        int repetitions = 10000;
        for (int j = 0; j < repetitions; j++ ) {
            ksession.insert( j );

        ksession.insert( "go" );

Comment 2 Mario Fusco 2014-01-29 18:46:20 UTC
Fixed by

Comment 3 Marek Winkler 2014-02-21 16:47:31 UTC
Verified that the fix is present in BRMS 6.0.1 ER1 and the corresponding test passes.

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