-
Sub-task
-
Resolution: Done
-
L3 - Default
-
None
-
None
Given:
Two Job Executor threads.
When:
Both Job Executors attempt to concurrently acquire the same jobs.
Then:
The second Job Executor fails to correctly utilize the Back-off algorithm due to an undetected OLE. The following exception is thrown:
ERROR: restart transaction: TransactionRetryWithProtoRefreshError: TransactionRetryError: retry txn (RETRY_WRITE_TOO_OLD - WriteTooOld flag converted to WriteTooOldError): "sql txn" meta={id=260a2275 key=/Table/57/1/"10955"/0 pri=0.00050915 epo=0 ts=1594130960.041192598,1 min=1594130959.871861724,0 seq=1} lock=true stat=PENDING rts=1594130960.041192598,1 wto=false max=1594130959.871861724,0 Call getNextException to see other errors in the batch. ### Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.JobEntity.updateAcquirableJob (batch index #1) failed. Cause: java.sql.BatchUpdateException: Batch entry 0 update ACT_RU_JOB
Expected:
The second Job Executor correctly detects an OLE, or correctly handles the above Exception, and does a back-off.
Note:
- The exception above occurs due to CRDB's own Optimistic Locking mechanism. Implementing a Transaction Retries mechanism will resolve this issue.
- The same problem occurs with any concurrent operation that is expected to produce an Optimistic Locking Exception.