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

FireAllRules can trigger java.util.concurrent.RejectedExecutionException from the JDKTimerService

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.0.0.Beta2
    • 6.3.0.Final, 6.4.0.Final
    • None
    • None
    • NEW
    • NEW

      Under very rare circumstance we have found the following exception java.util.concurrent.RejectedExecutionException in our production log.

      Our guess is that the Drools Session is on its way to be dispose, while a new incoming request is in the middle of a fireAllRules operation (race condition).

      I will try to provide a reproducible testcase for this.

      Caused by: java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@3e896443 rejected from java.util.concurrent.ScheduledThreadPoolExecutor@71cc2f4c[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
              at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2047)
              at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:823)
              at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:326)
              at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:549)
              at org.drools.core.time.impl.JDKTimerService.internalSchedule(JDKTimerService.java:118)
              at org.drools.core.time.impl.JDKTimerService.scheduleJob(JDKTimerService.java:101)
              at org.drools.core.phreak.PhreakTimerNode.scheduleTimer(PhreakTimerNode.java:304)
              at org.drools.core.phreak.PhreakTimerNode.scheduleLeftTuple(PhreakTimerNode.java:233)
              at org.drools.core.phreak.PhreakTimerNode.doLeftUpdates(PhreakTimerNode.java:131)
              at org.drools.core.phreak.PhreakTimerNode.doNode(PhreakTimerNode.java:65)
              at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:357)
              at org.drools.core.phreak.RuleNetworkEvaluator.outerEval(RuleNetworkEvaluator.java:161)
              at org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:116)
              at org.drools.core.phreak.RuleExecutor.reEvaluateNetwork(RuleExecutor.java:194)
              at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:67)
              at org.drools.core.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:935)
              at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1200)
              at org.drools.core.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:957)
              at org.drools.core.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:936)
              at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:260)
              at XXXXXX.XXXXX.XXXXX.processEventDrools(EventProcessorImpl.java:128)
              at XXXXXX.XXXXX.XXXXX.processEvent(EventProcessorImpl.java:101)
      

              mfusco@redhat.com Mario Fusco
              jcgarciam_jira Juan Carlos Garcia (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: