Skip to content

v5.4.4: Handle deadlocks in job coalescing

Choose a tag to compare

@thorewi thorewi released this 22 Jun 06:10
· 14 commits to master since this release
The `markCoalescedJobsRedundant` operation can encounter transient database deadlocks (1213) during concurrent writes. This could leave jobs stuck in a PROCESSING state.

This change adds a retry mechanism with a back-off delay for the coalesce UPDATE to overcome these transient deadlocks. Additionally, a new index `(serial_group, coalesce_threshold)` is added to optimize the WHERE clause, reducing lock contention and preventing deadlocks by allowing targeted index scans.