Acquire only one exclusive external worker job per process instance
Fixes #3509
Check List:
- Unit tests: YES
- Documentation: NO
This solution has a side effect. When one exclusive external worker job (a) is acquired and an other exclusive external worker job (b) belonging to the same process/case instance with the same topic is ready for acquiring a FlowableOptimisticLockingException is thrown and the acquire transaction is rolled back. This will prevent other external external worker jobs which are ready for acquiring with the same topic (exclusive or not) belonging to other process/case instances to be acquired until (a) is completed.
I'll work on another solution proposal for #3509 which does not have the side effect mentioned above.
Thanks for working on this and good point @basclaessen. We are going to review this and try to come up with the right solution. Ideally we should try to avoid the side effect in this solution.