flowable / flowable/flowable-engine
Add Random Wait Backoff for Acquire Async Jobs, Acquire Timer Jobs and Reset Expired Jobs
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.9k
- Avg merge
- 7h 8m
- Merged PRs (30d)
- 2
Description
**Is your feature request related to a problem? Please describe.**
We have flowable deployed in a clustered environment using SQL Server with Snapshot Isolation turned on. When there are multiple nodes trying to get async jobs, timer jobs or reset expired jobs at the same time we get a SQLServerException (Snapshot isolation transaction aborted due to update conflict. You cannot use snapshot isolation to access table 'dbo.ACT_RU_JOB' directly or indirectly in database 'casetivity' to update, delete, or insert the row that has been modified or deleted by another transaction. Retry the transaction or change the isolation level for the update/delete statement.) which would be fine, except they all have the same retry time so they end up having these collisions over and over and only sometimes break out of it. We are working around this now by extending these runnable jobs and adding a random wait if any exception is thrown during them.
**Describe the solution you'd like**
Adding a random wait when any exception happens in one of the above jobs.
**Describe alternatives you've considered**
We considered adding different job retry times to each node in the cluster but we are in a dockerized AWS container and passing these different values in an environment variable was a little more difficult than adding the random wait, but we could do this.
**Additional context**
Maybe only an issue with SQL Server, but it would seem to at least be an issue in theory with other DBs.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.