Uploaded image for project: 'Red Hat Process Automation Manager'
  1. Red Hat Process Automation Manager
  2. RHPAM-4583

Exception is swallowed by jbpm executor that leads to the transaction timeout without properly cleaned up

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Major
    • None
    • 7.13.1.GA
    • jBPM Core
    • None
    • False
    • None
    • False
    • ---
    • ---
    • 2022 Week 47-49 (from Nov 21), 2022 Week 50-02 (from Dec 12), 2023 Week 03-05 (from Jan 16), 2023 Week 06-08 (from Feb 6)
    • Customer Escalated

    Description

      The handleException method in the AbstractAvailableJobsExecutor class [1] only logs a WARN message for the exception without throwing it.

      Here is an example of logging and stacktrace:

      2022-11-15 01:02:00,346 WARN [pool-7-thread-3] org.drools.persistence.PersistableRunner: Could not commit session
      org.jbpm.workflow.instance.WorkflowRuntimeException: – null
      at org.jbpm.workflow.instance.node.WorkItemNodeInstance.processWorkItemHandler(WorkItemNodeInstance.java:170)
      at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:141)
      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:206)
      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:414)
      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:392)
      at org.jbpm.workflow.instance.node.AsyncEventNodeInstance.triggerCompleted(AsyncEventNodeInstance.java:122)
      at org.jbpm.workflow.instance.node.AsyncEventNodeInstance$AsyncExternalEventListener.signalEvent(AsyncEventNodeInstance.java:137)
      at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.signalEvent(WorkflowProcessInstanceImpl.java:659)
      at org.drools.core.command.runtime.process.SignalEventCommand.execute(SignalEventCommand.java:123)
      at org.drools.core.command.runtime.process.SignalEventCommand.execute(SignalEventCommand.java:37)
      at org.drools.core.fluent.impl.PseudoClockRunner.executeBatch(PseudoClockRunner.java:102)
      at org.drools.core.fluent.impl.PseudoClockRunner.executeBatches(PseudoClockRunner.java:69)
      at org.drools.core.fluent.impl.PseudoClockRunner.execute(PseudoClockRunner.java:61)
      at org.drools.core.fluent.impl.PseudoClockRunner.execute(PseudoClockRunner.java:39)
      at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:39)
      at org.drools.persistence.PersistableRunner$TransactionInterceptor.execute(PersistableRunner.java:608)
      at org.drools.persistence.PersistableRunner$TransactionInterceptor.execute(PersistableRunner.java:568)
      at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:39)
      at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.internalExecute(OptimisticLockRetryInterceptor.java:102)
      at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:83)
      at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:44)
      at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:39)
      at org.drools.persistence.jta.TransactionLockInterceptor.execute(TransactionLockInterceptor.java:73)
      at org.drools.persistence.jta.TransactionLockInterceptor.execute(TransactionLockInterceptor.java:45)
      at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:39)
      at org.jbpm.runtime.manager.impl.error.ExecutionErrorHandlerInterceptor.internalExecute(ExecutionErrorHandlerInterceptor.java:66)
      at org.jbpm.runtime.manager.impl.error.ExecutionErrorHandlerInterceptor.execute(ExecutionErrorHandlerInterceptor.java:52)
      at org.jbpm.runtime.manager.impl.error.ExecutionErrorHandlerInterceptor.execute(ExecutionErrorHandlerInterceptor.java:29)
      at org.drools.persistence.PersistableRunner.execute(PersistableRunner.java:400)
      at org.drools.persistence.PersistableRunner.execute(PersistableRunner.java:68)
      at org.drools.core.runtime.InternalLocalRunner.execute(InternalLocalRunner.java:37)
      at org.drools.core.runtime.InternalLocalRunner.execute(InternalLocalRunner.java:41)
      at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.signalEvent(CommandBasedStatefulKnowledgeSession.java:255)
      at org.jbpm.process.core.async.AsyncSignalEventCommand.execute(AsyncSignalEventCommand.java:53)
      at org.jbpm.executor.impl.AbstractAvailableJobsExecutor.executeGivenJob(AbstractAvailableJobsExecutor.java:135)
      at org.jbpm.executor.impl.AvailableJobsExecutor.executeJob(AvailableJobsExecutor.java:33)
      at org.jbpm.executor.impl.concurrent.PrioritisedRunnable.run(PrioritisedRunnable.java:47)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
      at org.jbpm.executor.impl.concurrent.PrioritisedScheduledFutureTask.run(PrioritisedScheduledFutureTask.java:41)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
      Caused by: java.lang.NullPointerException: null
      at myown.custom.RESTWorkItemHandler.executeWorkItem(RESTWorkItemHandler.java:422)
      at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalExecuteWorkItem(JPAWorkItemManager.java:69)
      at org.jbpm.workflow.instance.node.WorkItemNodeInstance.lambda$internalTrigger$0(WorkItemNodeInstance.java:141)
      at org.jbpm.workflow.instance.node.WorkItemNodeInstance.processWorkItemHandler(WorkItemNodeInstance.java:155)
      ... 44 common frames omitted

      This ends up with a transaction timeout:
      2022-11-15 01:03:00,548 WARN [Transaction Reaper Worker 0] com.arjuna.ats.arjuna: ARJUNA012381: Action id 0:ffff0a660760:941d:6372e4b1:291 completed with multiple threads - thread pool-7-thread-3 was in progress with sun.misc.Unsafe.park(Native Method)

      Can we review the code to make sure the exception is properly handled?

      [1] https://github.com/kiegroup/jbpm/blob/main/jbpm-services/jbpm-executor/src/main/java/org/jbpm/executor/impl/AbstractAvailableJobsExecutor.java#L230-L280

      Attachments

        Activity

          People

            ftirados Francisco Javier Tirado Sarti
            rhn-support-ghu Gary Hu
            Gonzalo Muñoz Fernández Gonzalo Muñoz Fernández
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: