Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-7328

Sliding Time Window: Performance problem

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 8.35.0.Final
    • 8.33.0.Final
    • None
    • None
    • 2023 Week 06-08 (from Feb 6)
    • NEW
    • NEW
    • ---
    • ---

      Under a load of hundreds of thousands of events per sliding time window, the core starts to lag.

      Thread dump:

      "main@1" prio=5 tid=0x1 nid=NA runnable
        java.lang.Thread.State: RUNNABLE
            at java.util.PriorityQueue.indexOf(PriorityQueue.java:357)
            at java.util.PriorityQueue.remove(PriorityQueue.java:376)
            at org.drools.core.rule.SlidingTimeWindow$SlidingTimeWindowContext.remove(SlidingTimeWindow.java:285)
            at org.drools.core.rule.SlidingTimeWindow.retractFact(SlidingTimeWindow.java:157)
            at org.drools.core.rule.BehaviorManager.retractFact(BehaviorManager.java:99)
            at org.drools.core.reteoo.WindowNode.retractRightTuple(WindowNode.java:157)
            at org.drools.core.reteoo.RightTupleImpl.retractTuple(RightTupleImpl.java:262)
            at org.drools.core.reteoo.ObjectTypeNode.lambda$retractRightTuples$2(ObjectTypeNode.java:337)
            at org.drools.core.reteoo.ObjectTypeNode$$Lambda$176.793618227.accept(Unknown Source:-1)
            at org.drools.core.common.DefaultFactHandle$SingleLinkedTuples.forEachRightTuple(DefaultFactHandle.java:694)
            at org.drools.core.common.DefaultFactHandle.forEachRightTuple(DefaultFactHandle.java:914)
            at org.drools.core.reteoo.ObjectTypeNode.retractRightTuples(ObjectTypeNode.java:337)
            at org.drools.kiesession.agenda.DefaultAgenda.doRetract(DefaultAgenda.java:1345)
            at org.drools.kiesession.agenda.DefaultAgenda.flushExpirations(DefaultAgenda.java:1336)
            at org.drools.kiesession.agenda.DefaultAgenda.fireLoop(DefaultAgenda.java:757)
            at org.drools.kiesession.agenda.DefaultAgenda.internalFireAllRules(DefaultAgenda.java:694)
            at org.drools.kiesession.agenda.DefaultAgenda.fireAllRules(DefaultAgenda.java:686)
            at org.drools.kiesession.session.StatefulKnowledgeSessionImpl.internalFireAllRules(StatefulKnowledgeSessionImpl.java:1092)
            at org.drools.kiesession.session.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1083)
            at org.drools.kiesession.session.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1067) 

      There is some complexity around queue and removing elements:

        1. image-2023-02-03-00-40-47-127.png
          199 kB
          Radoslav Ivanov
        2. image-2023-03-01-16-57-39-869.png
          17 kB
          Radoslav Ivanov
        3. image-2023-03-01-21-59-45-093.png
          22 kB
          Radoslav Ivanov

              mfusco@redhat.com Mario Fusco
              rady66@hotmail.com Radoslav Ivanov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: