cancel
Showing results for 
Search instead for 
Did you mean: 

Problem caused by multiple asynchronous sub process finishing around the same time.

domreiroam
Champ in-the-making
Champ in-the-making
Hi all,

We need to launch multiple (up to 24) sub-process from a Main process. Each sub-process will have multiple asynchronous task. 

We noticed an issue when multiple sub-process finish in the same time: we get errors like ActivitiOptimisticLockingException and the activiti engine will retry the sub-process . This behaviour causes 2 problems:
  • The first problem is that the last tasks of the sub-process will be executed again, so we must be sure that these tasks are allowed to run multiple time.
  •  
  • The second problem is that some time one sub-process is retried to much and fail ( maximum number retries reached).
We have this problem only with Oracle or PostgreSQL never with H2. We made a jUnit test that shows the behaviour by launching a sub-process containing a counter that should be increased only once by sub-process.

It may be related to ACT-2126 but in our junit we managed to run sub-process in parallel. We have only the problem when merging back to the main process.

Would like that we open a ticket? We can join our project with the jUnit test.

Regards,

Gael

4 REPLIES 4

jbarrez
Star Contributor
Star Contributor
If you have multiple servers and fire jobs for the same process instance, then optimistic locking is expected. You could solve it by making them exclusive (but with multiple servers it might still happen). The reason why H2 doesn't show it could be because H2 has a much more coarse locking vs 'real' databases.

The unit test would be fantastic to understand. You can indeed create an issue and attach it.

domreiroam
Champ in-the-making
Champ in-the-making
We have the problem with only one server and we did reproduce in a junit using the last version (5.18)

domreiroam
Champ in-the-making
Champ in-the-making
I just create ACT-4083.

jbarrez
Star Contributor
Star Contributor
Ok, thanks. Will look into it and discuss further in the jira issue.