Hi, community.
I am wondering about concurrent execution on parallel gateways. There are two contradicted statements in the documentation
The Job Executor makes sure that jobs from a single process instance are never executed concurrently
https://docs.camunda.org/manual/7.19/user-guide/process-engine/the-job-executor/#concurrent-job-execution
and
The instances are executed concurrently and independently from each other.
https://docs.camunda.io/docs/components/modeler/bpmn/multi-instance/
What I really discovered is that they are effectively run sequentially for each process instance (simple bp with parallel gateways with 3 sequence flow with script task in each branch).
Can I somehow tune this behavior and achieve concurrency or it is restricted by design? Additionally, I am just wondering how Camunda engine handles this branches, because I expected to find a separate job in act_ru_job table, but it was actually 1 (that is created before parallel gateway)?
Hi @Pavlo_Yemelianov,
The following only applies to Camunda 7:
Camunda 7 uses a relational database. The engine’s default configuration minimizes transactions to improve the performance. I recommend that you read more about Camunda 7’s transaction management:
You can add additional transaction boundaries to control how jobs are created and enable true parallel processing. However, processing different branches of the same process can be risky.
1 Like
Parallel transactions have some disadvantages for the Camunda 7 platform. For example, if two service tasks are connected in parallel, problems may arise when they run simultaneously. Since task 1 and task 2 will run in separate contexts, for example if they work on the same variable, the outcome may not be deterministic in concurrent operations. To avoid such situations, the engine will actually perform the relevant operation sequentially.
1 Like
Hi @Pavlo_Yemelianov,
your second quote applies to Camunda 8. Here, all processing is done by events in parallel.
Hope this helps, Ingo
1 Like