-
Bug
-
Resolution: Done
-
Major
-
7.13.4.SP2, IBM BAMOE 8.0.4.GA
In a process containing a task with a boundary timer, we can see that the timer gets executed twice in the following setup:
- Environment entry Async=true
- Timer PT30M (shorter timers don't show issues)
Note that this can be reproduced on a single kie-server node.
When the EJB timer fires, the jobHandles are added to the GlobalTimerService map here:
https://github.com/kiegroup/jbpm/blob/main/jbpm-flow/src/main/java/org/jbpm/process/core/timer/impl/GlobalTimerService.java#L120
The same thread is then responsible for removing the timer from the session. However, with long running timers the following logic is broken:
https://github.com/kiegroup/jbpm/blob/main/jbpm-flow/src/main/java/org/jbpm/process/core/timer/impl/GlobalTimerService.java#L155
This leads to the jobHandle not getting removed from the map before the session gets persisted. When the async execution happens and the session is deserialized, the timer gets recreated (a new EJB timer will be created). This new timer then leads to the second execution of the node.