Bug 874187 - NPE when an event expires during evaluation of accumulate when run as fireUntilHalt()
Summary: NPE when an event expires during evaluation of accumulate when run as fireUnt...
Keywords:
Status: NEW
Alias: None
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRE (Expert, Fusion)
Version: BRMS 5.3.1
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: ---
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-07 16:39 UTC by Marek Winkler
Modified: 2024-01-01 01:36 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)
NPE stack trace. (4.50 KB, text/plain)
2012-11-07 16:39 UTC, Marek Winkler
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker DROOLS-70 0 Major Open NPE when an event expires during evaluation of accumulate when run as fireUntilHalt() 2014-02-13 17:19:54 UTC

Description Marek Winkler 2012-11-07 16:39:24 UTC
Created attachment 640180 [details]
NPE stack trace.

Description of problem:

The AccumulateNode.getFirstMatch() throws NPE when some already collected event expires. The problem occurs when thread A is running StatefulKnowledgeSession.fireUntilHalt() while thread B is inserting new events into the session.

The problem occurs when @expires is defined on the event. The lower the @expires value, the more likely the NPE occurs.

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

5.3.1.BRMS-ER4 (verified on Drools 5.3.x branch)

How reproducible:
Will attach a link to pull request with a reproducer test.

Steps to Reproduce:

1. Run the test in org.drools.integrationtests.FireUntilHaltAccumulateTest
  
Actual results:

With a very high probability the NPE is thrown.

Expected results:

The test runs without throwing an exception.

Comment 1 Marek Winkler 2012-11-07 16:51:57 UTC
Pull request with test case is located at: https://github.com/droolsjbpm/drools/pull/163

Comment 3 JBoss JIRA Server 2013-03-12 17:14:37 UTC
Edson Tirelli <ed.tirelli> made a comment on jira DROOLS-70

Mario, I've been unable to reproduce this so far. I've run the test you created a ton of times in a loop, but I can't reproduce the error in an i7 cpu.

In any case, the problem here is that event expiration is a WMA, so it shouldn't happen concurrently with any other WMA action (like the insertion of new facts). If it is happening, then the locks in the session are not being properly handled.


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