[jboss-jira] [JBoss JIRA] (DROOLS-138) AccumulateNode throws NPE

Davide Sottara (JIRA) jira-events at lists.jboss.org
Tue May 14 15:41:06 EDT 2013


    [ https://issues.jboss.org/browse/DROOLS-138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12774299#comment-12774299 ] 

Davide Sottara commented on DROOLS-138:
---------------------------------------

Notice that the Thread.sleep() is a very unsafe way to synchronize the two threads, but at the same time it makes the insertion modality more "realistic"

                
> AccumulateNode throws NPE
> -------------------------
>
>                 Key: DROOLS-138
>                 URL: https://issues.jboss.org/browse/DROOLS-138
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 5.5.1.Final
>         Environment: ### OS ###
> Darwin <hostname redacted> 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64
> ### Java Version ###
> java version "1.6.0_45"
> Java(TM) SE Runtime Environment (build 1.6.0_45-b06-451-11M4406)
> Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01-451, mixed mode)
>            Reporter: Jason Barto
>            Assignee: Mark Proctor
>            Priority: Minor
>
> AccumulateNode throws a NPE when events are inserted too quickly via an entry-point.  A stateful knowledge session to which events are inserted and running an accumulate on the input events.  I have a for loop generating the events and inserting them as rapidly as possible.  In the rules I use an accumulator to calculate the average of the values contained within the events.  The behavior I'm observing is that if I insert ~120 events without any waiting I receive an NPE.  If I Thread.sleep for even just 1ms the test goes off without a hitch.  
> The NPE is as follows:
> Exception in thread "main" java.lang.NullPointerException
>         at org.drools.reteoo.AccumulateNode.getFirstMatch(AccumulateNode.java:1050)
>         at org.drools.reteoo.AccumulateNode.modifyLeftTuple(AccumulateNode.java:345)
>         at org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateModifyChildLeftTuple(SingleLeftTupleSinkAdapter.java:259)
>         at org.drools.reteoo.AccumulateNode.evaluateResultConstraints(AccumulateNode.java:676)
>         at org.drools.reteoo.ReteooWorkingMemory$EvaluateResultConstraints.execute(ReteooWorkingMemory.java:590)
>         at org.drools.common.PropagationContextImpl.evaluateActionQueue(PropagationContextImpl.java:350)
>         at org.drools.rule.SlidingLengthWindow.assertFact(SlidingLengthWindow.java:119)
>         at org.drools.rule.BehaviorManager.assertFact(BehaviorManager.java:94)
>         at org.drools.reteoo.WindowNode.assertObject(WindowNode.java:167)
>         at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)
>         at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:382)
>         at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)
>         at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)
>         at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:350)
>         at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:311)
>         at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:127)
>         at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:55)
>         at drools5fusioneval.Average.main(Average.java:66)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list