Bug 874187

Summary: NPE when an event expires during evaluation of accumulate when run as fireUntilHalt()
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Marek Winkler <mwinkler>
Component: BRE (Expert, Fusion)Assignee: Nobody <nobody>
Status: CLOSED UPSTREAM QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: BRMS 5.3.1CC: mfusco
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-02-10 03:21:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
NPE stack trace. none

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.

Comment 8 Red Hat Bugzilla 2025-02-10 03:21:06 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.