AnsweredAssumed Answered

Async job are not locked in clustered applications.

Question asked by victor1 on Aug 14, 2015
Latest reply on Aug 25, 2015 by trademak
Good afternoon!

I use two applications in a cluster.
JobExecutors configured as follows:

1 JobExecutor:

<property name="jobExecutor" ref="jobExecutor" />
<property name="jobExecutorActivate" value="false" />
<property name="asyncExecutor" ref="asyncExecutor" />
<property name="asyncExecutorEnabled" value="true" />
<property name="asyncExecutorActivate" value="true" />
<property name="defaultFailedJobWaitTime" value="1" />
<property name="asyncFailedJobWaitTime" value="1" />
<property name="history" value="full" />
<property name="dbIdentityUsed" value="false" />
<property name="dbHistoryUsed" value="true" />

<bean id="jobExecutor" class="org.activiti.engine.impl.jobexecutor.DefaultJobExecutor">
   <property name="corePoolSize" value="25" />
   <property name="maxPoolSize" value="50" />
   <property name="keepAliveTime" value="3000" />
   <property name="queueSize" value="200" />
   <property name="lockTimeInMillis" value="5000" />
   <property name="lockOwner" value="app1" />
   <property name="maxJobsPerAcquisition" value="1" />
</bean>


2 JobExecutor:

<property name="jobExecutor" ref="jobExecutor" />
<property name="jobExecutorActivate" value="false" />
<property name="asyncExecutor" ref="asyncExecutor" />
<property name="asyncExecutorEnabled" value="true" />
<property name="asyncExecutorActivate" value="true" />
<property name="defaultFailedJobWaitTime" value="1" />
<property name="asyncFailedJobWaitTime" value="1" />
<property name="history" value="full" />
<property name="dbIdentityUsed" value="false" />
<property name="dbHistoryUsed" value="true" />

<bean id="jobExecutor" class="org.activiti.engine.impl.jobexecutor.DefaultJobExecutor">
   <property name="corePoolSize" value="25" />
   <property name="maxPoolSize" value="50" />
   <property name="keepAliveTime" value="3000" />
   <property name="queueSize" value="200" />
   <property name="lockTimeInMillis" value="5000" />
   <property name="lockOwner" value="app2" />
   <property name="maxJobsPerAcquisition" value="1" />
</bean>


If i start two applications in a cluster with a single database where all nodes are located on different servers,
one application performs its own jobs, and the other performs its own jobs and jobs of the first application.

If I start all nodes in the cluster on 1 server (ie, two applications and the database with which they work are on one server), everything works fine.
All jobs locked and executed correctly.

Applications are the same.

Network delay may well affect the operation of applications?
Is there any setting in the Activiti to deal with this problem?

Outcomes