pefernan opened a new issue, #1959: URL: https://github.com/apache/incubator-kie-issues/issues/1959
It is possible to have concurrency problems when a process defines a parallel gateway with **async** activities (ej Service task) in one branch and User tasks in the other branch, ej:  In this scenario, a User could be operating with **User Tasks** in one branch while the **Async Service Task** in the other branch runs asynchronously in a different thread (and transaction) making that in some cases both branches try to write the process instance into DB at same time, leaving the process instance state in a inconsistent state. This could be avoided by enabling optimistic locking which will throw a `ProcessInstanceOptimisticLockingException`. In order to mitigate this problem, we want to be able to retry the user interactions with the proces / usertask endpoints. This can be done by enabling fault tolerance in the **jbpm-quarkus** (and **jbpm-with-drools-quarkus**) extensions using [Quarkus Smallrye Fault Tolerance](https://quarkus.io/guides/smallrye-fault-tolerance) extension (in Quarkus) and [Reisilence4j](https://resilience4j.readme.io/docs/getting-started) (in Springboot). With those extension, Process Codegen and Usertasks Codegen can annotate all the REST endpoints with _@Retry_ annotation that will allow retrying the rest call in case of exception (this is already being used in Data Index). Configuration: - A new flag will be enabled (`kogito.faultToleranceEnabled`) that will tell Codegen to add Retry annotation to the REST Endpoints. This feature will be enabled by default and can be disabled by setting the peroperty to false or if **Quarkus Smallrye Fault Tolerance** is not present. - Applications should have optimistic locking enabled (`kogito.persistence.optimistic.lock=true`) in their application.properties - Both extensions provide some default values for the retry annotation, but the customer should be in charge of adjusting it to its need using the right configuration. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
