martinweiler opened a new issue, #7269: URL: https://github.com/apache/incubator-kie/issues/7269
**Problem:** In `VertxJobScheduler`, registered `JobTimeoutInterceptor`s (such as `TransactionJobTimeoutInterceptor`) wrap the job execution in a database transaction before the job is executed. However, `ProcessInstanceAtomicLockStrategy` was previously only acquired downstream within the workflow engine (`AbstractProcessInstance`). When a timer fired concurrently with another operation on the same process instance (e.g., an external REST signal or another job execution): 1. The timer thread opened a database transaction, pinning its MVCC/read snapshot. 2. The timer thread then blocked waiting for the in-memory `ProcessInstanceAtomicLockStrategy` lock held by the concurrent operation. 3. After the concurrent operation committed and released the lock, the timer thread resumed execution within its already-open transaction containing a stale read view. 4. Subsequent writes resulted in optimistic locking failures / MVCC serialization conflicts, causing transaction rollback and unnecessary job retries. **Proposed solution:** 1. Wrap the intercepted timeout execution in `VertxJobScheduler` with `ProcessInstanceAtomicLockStrategy.instance().executeOperation(processInstanceId, ...)` so that the process instance lock is acquired prior to starting the database transaction. 2. Optimize `GenericRepository` event type updates to avoid redundant delete/insert cycles when event types have not changed. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
