flowable / flowable/flowable-engine

Async multi-instance activities roll back too far if their creation fails

Open
#2,930 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
9.5k
Forks
2.9k
Avg merge
7h 8m
Merged PRs (30d)
2

Description

A flow node with multi-instance characteristics marked as asynchronous is still initially executed synchronously by the ContinueProcessOperation. If a failure happens during the initialization of the multi-instance, e.g. the referenced collection does not exist, then a rollback occurs. However, this rollback disregards that the asynchronous flow node should be a wait state and instead rolls back to the beginning of the most recent preceding asynchronous activity.

Example: Start Event --> Async Script Task --> Async Multi-Instance Call Activity --> End Event
If the multi-instance call activity fails because the collection variable cannot be resolved, then the execution is rolled back all the way to before the script task, whereas the expectation would be that the execution is rolled back only to the beginning of the call activity, because it is marked as asynchronous.

I have already created https://github.com/flowable/flowable-engine/pull/2831 which fixes this by removing the special case for multi-instance activities in ContinueProcessOperation, so that any asynchronous flow node again first commits the transaction and creates a new async-continuation job and is then actually being executed when it is later picked up by the job executor, same as all other async activities.

Since there has not yet been any reaction to the pull request in the last three month I'm opening this issue to get confirmation that the issue is acknowledged and the fix is acceptable and can be included in upcoming Flowable releases. (The change is 6 lines of productive code changes, the rest are tests)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.