AnsweredAssumed Answered

Async Job Executor only executes job after lock expiration

Question asked by jritter on Sep 29, 2017
Latest reply on May 2, 2018 by oluetkeh



We are currently in the process of upgrading our Activiti deployment from version 6.18 to version 6.0, which includes also the new Async Job executor. While giving activiti 6 a try, I noticed something which I could not explain:


The documentation says, that if the asyncExecutor for a process engine is enabled, it would insert a job into the ACT_RU_JOB table and instantly lock it, and then dispatch it to the job executor running in the same process engine. I've observed that it creates the table row in ACT_RU_JOB with a lock, but then it doesn't execute it for a reason I cannot understand. As soon as the lock expires, the job executor of this engine aquires the job and executes it, but I expect that to happen immediately after inserting the Job into ACT_RU_JOB. Another interesting fact: This is not always the case, there are instances that run through immediately, as I would expect. I've also not saturated the engine, I've observed that behavior when there was no load at all.


We are using PostgreSQL as activiti database.


Here my process instance configuration:

    <bean id="executorProcessEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
        <property name="dataSource" ref="dataSource" />
        <property name="transactionManager" ref="transactionManager" />
        <property name="databaseSchemaUpdate" value="true" />
        <property name="asyncExecutorActivate" value="true" />
        <property name="asyncExecutorThreadPoolQueueSize" value="100" />
        <property name="asyncExecutorMaxPoolSize" value="50" />
        <property name="asyncExecutorNumberOfRetries" value="3" />
        <property name="asyncExecutorMaxAsyncJobsDuePerAcquisition" value="1" />
        <property name="asyncExecutorDefaultAsyncJobAcquireWaitTime" value="2000" />
        <property name="asyncExecutorDefaultTimerJobAcquireWaitTime" value="2000" />
        <property name="eventListeners">
                <bean class="..." />
                <bean class="..." />


Has anybody seen this?


Any help is appreciated.


Regards, Jürg