Hello,
I have some issues caused by what I assume is tasks not being locked long enough when executed in parallel. Stack trace is a s follows:
org.camunda.bpm.client.exception.NotAcquiredException: TASK/CLIENT-01007 Exception while extending lock: The task's most recent lock could not be acquired
at org.camunda.bpm.client.impl.ExternalTaskClientLogger.externalTaskServiceException(ExternalTaskClientLogger.java:116) ~[camunda-external-task-client-7.16.0.jar:7.16.0]
at org.camunda.bpm.client.task.impl.ExternalTaskServiceImpl.extendLock(ExternalTaskServiceImpl.java:160) ~[camunda-external-task-client-7.16.0.jar:7.16.0]
at org.camunda.bpm.client.task.impl.ExternalTaskServiceImpl.extendLock(ExternalTaskServiceImpl.java:152) ~[camunda-external-task-client-7.16.0.jar:7.16.0]
at io.company.tasks.MyExternalTaskHandler.execute(MyExternalTaskHandler.java:266) ~[classes/:?]
at org.camunda.bpm.client.topic.impl.TopicSubscriptionManager.handleExternalTask(TopicSubscriptionManager.java:152) ~[camunda-external-task-client-7.16.0.jar:7.16.0]
at org.camunda.bpm.client.topic.impl.TopicSubscriptionManager.lambda$acquire$0(TopicSubscriptionManager.java:108) ~[camunda-external-task-client-7.16.0.jar:7.16.0]
at java.util.Arrays$ArrayList.forEach(Arrays.java:4204) [?:?]
at org.camunda.bpm.client.topic.impl.TopicSubscriptionManager.acquire(TopicSubscriptionManager.java:103) [camunda-external-task-client-7.16.0.jar:7.16.0]
at org.camunda.bpm.client.topic.impl.TopicSubscriptionManager.run(TopicSubscriptionManager.java:87) [camunda-external-task-client-7.16.0.jar:7.16.0]
at java.lang.Thread.run(Thread.java:833) [?:?]
I am trying to find which exact task causes this, but I’m having some issues. My main issue is that I would assume tasks are locked per task instance, but from what I’m seeing in logs, that doesn’t seem to be the case.
Let’s say I have process instances A, B, C, D. A and B are instances of process_definition1 and C and D are instances of process_definition2.
If I look at process instance A, I can see that previous service task has completed successfully, and after some time and work on processes B/C/D, worker starts processing next service task for A. It tries to extend lock to a predicted processing time and that’s when I get the exception above.
Is this possible, or am I missing someplace where we’re processing tasks? If it’s possible, how exactly does Camunda lock external tasks? Topic name/task id/something else?
Thank you for your time