flowable / flowable/flowable-engine
Job-service: Parallel exclusive external worker tasks with the same topic block acquiring external worker jobs
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.9k
- Avg merge
- 7h 8m
- Merged PRs (30d)
- 2
Description
**Describe the bug**
When multiple exclusive external worker jobs with the same topic belonging to the same process instance are available for acquiring, no external worker jobs will be acquired.
This is caused by the AcquireExternalWorkerJobsCmd which will try to lock the same process instance for each external worker job.
Locking the process instance for the first external worker job will succeed, but the second one will cause a FlowableOptimisticLockingException.
The FlowableOptimisticLockingException will rollback the acquire process and after a couple of retries no external worker jobs will be acquired.
**Expected behavior**
When multiple exclusive external worker jobs with the same topic belonging to the same process instance are available for acquiring, non exclusive external worker jobs and exclusive worker jobs (one per process instance) will be acquired.
**Code**

**Additional context**
Flowable 6.7.3-SNAPSHOT
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing AcquireExternalWorkerJobsCmd and the process-instance locking path described in the report. Reproduce the case with multiple exclusive external worker jobs sharing a topic and process instance, then verify that acquisition no longer rolls back and that non-exclusive jobs plus at most one exclusive job per process instance are acquired.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100