Scenario:
- BPMN process with
- Task A: async continuation that uses a custom retry cycle or interval
- Task B: async continuation
- Both async continuations are exclusive
- Process instance reaches task A; job 1 is created and fails; retry time cycle is applied
- While Job 1 is failed, process instance reaches task B (e.g. via process instances modification; user task completion; ...), creates job 2
Current behavior:
- Job 2 is only executed once job 1's retry timeout has expired
Expected behavior:
- Job 2 is immediately executed after creation
Root cause:
- When a job with a custom retry time cycle fails, it remains locked (i.e. lock owner and lock expiration time are set)
- In particular, the retry timeout is stored as the lock expiration timeout
- In consequence, the job executor will not acquire any other jobs of that process instance, because it thinks that the locked job is still executed
Proposed Fix:
- The command that applies the retry time cycle should unlock the job and set the timeout as the job's duedate
Hint:
- The lock owner is not set to null when the retry time cycle is applied, see DefaultJobRetryCmd