Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-3671

NPE in SlidingLengthWindow.assertFact when some event in window expired

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • 6.0.0.Alpha1
    • 5.4.0.Final, 5.5.0.Beta1, 5.5.0.CR1
    • None
    • Hide

      To reproduce, you can use existing test org.drools.integrationtests.CepEspTest#testCollectWithWindows in Drools Compiler.

      Simply comment @expires( 2m ) in event declaration in test_CEP_collectWithWindows.drl and run the test.

      Show
      To reproduce, you can use existing test org.drools.integrationtests.CepEspTest#testCollectWithWindows in Drools Compiler. Simply comment @expires( 2m ) in event declaration in test_CEP_collectWithWindows.drl and run the test.

    Description

      Consider the following DRL (taken from the CepEspTest integration test, the only modification is commenting out the @expires declaration):

      test_CEP_collectWithWindows.drl
      package org.drools;
      
      import java.util.List
      
      global List timeResults;
      global List lengthResults;
      
      declare OrderEvent
          @role( event )
          //@expires( 2m )
      end
      
      rule "collect with time window"
      when
          $list : List( empty == false ) from collect(
                    $o : OrderEvent() over window:time(30s) )
      then
          timeResults.add( $list.size() );
      end
      
      rule "collect with length window"
      when
          $list : List( empty == false ) from collect(
                    $o : OrderEvent() over window:length(3) )
      then
          lengthResults.add( $list.size() );
      end
      

      When you insert more than 3 events and advance pseudo clock time such that an event in the length window expires, a NPE at org.drools.rule.SlidingLengthWindow.assertFact(SlidingLengthWindow.java:115) is thrown. See the attachment for complete stack trace.

      The original test with the @expires declaration uncommented passes.

      The problem seems not to be present in Drools 5.3.3.Final.

      Attachments

        Activity

          People

            etirelli@redhat.com Edson Tirelli
            mwinkler@redhat.com Marek Winkler (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

            Dates

              Created:
              Updated:
              Archived:

              PagerDuty