Bug with concurrentExecution

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2016 08:20 AM
Hi,
I am using Activiti 5.17 and facing concurrent execution problem in my workflow seems like a activiti bug to me. I am working on a real time scenario like, there will be 8 parallel user tasks attached with boundary timer and service task. I am passing expression to the each service task. All these service tasks will be triggered at the same time. Some times, I notice that few service tasks reading other serviceTask's expression and doing false execution.
I am trying to isolate this problem with a junit test case and attaching to this ticket. In this test case, Initially, I turned OFF "jobExecutorActivate" and ran the test case ProcessTestMyProcess1.java so, there will be 8 jobs active in ACT_RU_JOB table, now, turn ON "jobExecutorActivate" and run it. It will execute all 16 jobs and should print 2 statements for each service task but, which is not happening. For few service tasks printing other service task related expression data.
(attached my test case maven module. please rename .txt to .zip and extract it to see the files.) Please change the db urls
Thanks,
Swamy.
I am using Activiti 5.17 and facing concurrent execution problem in my workflow seems like a activiti bug to me. I am working on a real time scenario like, there will be 8 parallel user tasks attached with boundary timer and service task. I am passing expression to the each service task. All these service tasks will be triggered at the same time. Some times, I notice that few service tasks reading other serviceTask's expression and doing false execution.
I am trying to isolate this problem with a junit test case and attaching to this ticket. In this test case, Initially, I turned OFF "jobExecutorActivate" and ran the test case ProcessTestMyProcess1.java so, there will be 8 jobs active in ACT_RU_JOB table, now, turn ON "jobExecutorActivate" and run it. It will execute all 16 jobs and should print 2 statements for each service task but, which is not happening. For few service tasks printing other service task related expression data.
(attached my test case maven module. please rename .txt to .zip and extract it to see the files.) Please change the db urls
Thanks,
Swamy.
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2016 07:51 AM
I tested your project, you have a misconfiguration in your logging. The moment I added slf4j-api as a dependency, I could see
01:49:54,706 [pool-1-thread-2] INFO com.uprr.activiti.practice.spring.SimpleServiceTask - This is called from ServiceTask : Service Task3
01:49:54,706 [pool-1-thread-1] INFO com.uprr.activiti.practice.spring.SimpleServiceTask - This is called from ServiceTask : Service Task3
01:49:54,706 [pool-1-thread-2] INFO com.uprr.activiti.practice.spring.SimpleServiceTask - This is called from ServiceTask : Service Task3
01:49:54,706 [pool-1-thread-1] INFO com.uprr.activiti.practice.spring.SimpleServiceTask - This is called from ServiceTask : Service Task3

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2016 10:49 AM
Thank you Joram for your reply. But, My observation is different and described as follows.
When I run second time by turning ON jobExecutorActivate, I got the following log. If you see first 8 lines printed by pending jobs for previous instance. and last 8 lines are for 2nd process instance. If you see first 2 lines in first set, pool-1-thread-2 & pool-1-thread-1 read same expression and ServiceTask1 form property passed from bpmn model never used. Some times, 3 threads reads same expression though I pass different in service task properties in bpmn. For me, in real time, I am triggering mail from each service task. In this case, instead of ServiceTask1 related mail, I am receiving service task2 mail for twice.
[09:31:21.023]::INFO :
ool-1-thread-2::com.uprr.activiti.practice.spring.SimpleServiceTask:16 - This is called from ServiceTask : Service Task2
[09:31:21.023]::INFO :
ool-1-thread-1::com.uprr.activiti.practice.spring.SimpleServiceTask:16 - This is called from ServiceTask : Service Task2
[09:31:21.027]::INFO :
ool-1-thread-5::com.uprr.activiti.practice.spring.SimpleServiceTask:16 - This is called from ServiceTask : Service Task8
[09:31:21.031]::INFO :
ool-1-thread-4::com.uprr.activiti.practice.spring.SimpleServiceTask:16 - This is called from ServiceTask : Service Task7
[09:31:21.041]::INFO :
ool-1-thread-3::com.uprr.activiti.practice.spring.SimpleServiceTask:16 - This is called from ServiceTask : Service Task3
[09:31:21.087]::INFO :
ool-1-thread-5::com.uprr.activiti.practice.spring.SimpleServiceTask:16 - This is called from ServiceTask : Service Task4
[09:31:21.102]::INFO :
ool-1-thread-4::com.uprr.activiti.practice.spring.SimpleServiceTask:16 - This is called from ServiceTask : Service Task5
[09:31:21.114]::INFO :
ool-1-thread-2::com.uprr.activiti.practice.spring.SimpleServiceTask:16 - This is called from ServiceTask : Service Task6
[09:31:30.908]::INFO :
ool-1-thread-5::com.uprr.activiti.practice.spring.SimpleServiceTask:16 - This is called from ServiceTask : Service Task1
[09:31:30.918]::INFO :
ool-1-thread-4::com.uprr.activiti.practice.spring.SimpleServiceTask:16 - This is called from ServiceTask : Service Task2
[09:31:30.931]::INFO :
ool-1-thread-2::com.uprr.activiti.practice.spring.SimpleServiceTask:16 - This is called from ServiceTask : Service Task3
[09:31:30.954]::INFO :
ool-1-thread-5::com.uprr.activiti.practice.spring.SimpleServiceTask:16 - This is called from ServiceTask : Service Task4
[09:31:30.971]::INFO :
ool-1-thread-4::com.uprr.activiti.practice.spring.SimpleServiceTask:16 - This is called from ServiceTask : Service Task5
[09:31:30.990]::INFO :
ool-1-thread-2::com.uprr.activiti.practice.spring.SimpleServiceTask:16 - This is called from ServiceTask : Service Task6
[09:31:31.014]::INFO :
ool-1-thread-5::com.uprr.activiti.practice.spring.SimpleServiceTask:16 - This is called from ServiceTask : Service Task7
[09:31:31.039]::INFO :
ool-1-thread-4::com.uprr.activiti.practice.spring.SimpleServiceTask:16 - This is called from ServiceTask : Service Task8
Can't we use DelegateExpressions with fields in ServiceTasks in parallel flow?
thanks,
swamy.
When I run second time by turning ON jobExecutorActivate, I got the following log. If you see first 8 lines printed by pending jobs for previous instance. and last 8 lines are for 2nd process instance. If you see first 2 lines in first set, pool-1-thread-2 & pool-1-thread-1 read same expression and ServiceTask1 form property passed from bpmn model never used. Some times, 3 threads reads same expression though I pass different in service task properties in bpmn. For me, in real time, I am triggering mail from each service task. In this case, instead of ServiceTask1 related mail, I am receiving service task2 mail for twice.
[09:31:21.023]::INFO :

[09:31:21.023]::INFO :

[09:31:21.027]::INFO :

[09:31:21.031]::INFO :

[09:31:21.041]::INFO :

[09:31:21.087]::INFO :

[09:31:21.102]::INFO :

[09:31:21.114]::INFO :

[09:31:30.908]::INFO :

[09:31:30.918]::INFO :

[09:31:30.931]::INFO :

[09:31:30.954]::INFO :

[09:31:30.971]::INFO :

[09:31:30.990]::INFO :

[09:31:31.014]::INFO :

[09:31:31.039]::INFO :

Can't we use DelegateExpressions with fields in ServiceTasks in parallel flow?
thanks,
swamy.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2016 02:55 AM
Not sure I'm following here … but looking at the threads that execute the logic is saying not a lot - maybe it's a thread pool configuration thing, maybe it's a hardware kind of thing.
The easiest would be if you have a unit test that clearly demonstrates the problem you see.
The easiest would be if you have a unit test that clearly demonstrates the problem you see.
