bunqueue v2.8.17
blog · release
bunqueue v2.8.17
Fixes 1 bug. Retrying a job that reached failed through the lock-expiry path failed with UNIQUE constraint failed: jobs.id (src/application/lockManager.ts): handleMaxStallsExceeded moved the job to the DLQ using only in-memory state…
To install bunqueue v2.8.17
Section titled “To install bunqueue v2.8.17”bun add bunqueue@2.8.17npm install bunqueue@2.8.17To upgrade bunqueue
Section titled “To upgrade bunqueue”bun add bunqueue@latestBugfixes
Section titled “Bugfixes”- Retrying a job that reached
failedthrough the lock-expiry path failed withUNIQUE constraint failed: jobs.id(src/application/lockManager.ts):handleMaxStallsExceededmoved the job to the DLQ using only in-memory state (shard.addToDlq+jobIndex.set). Unlike its three sibling paths,ack.moveFailedJobToDlq(max attempts),stallDetection.moveStalliedJobToDlq(heartbeat stall), and the startup recovery inbackgroundTasks, it never calledstorage.saveDlqEntry(entry)norstorage.deleteJob(jobId). So thejobsrow survived in SQLite as an orphan (stateactive) and the DLQ entry lived only in memory. On retry,dlqManager.retryDlqJobre-INSERTs the job with its original id via the plainINSERT INTO jobsstatement (notINSERT OR REPLACElikeinsertResult/insertCron), and the surviving orphan row raised the UNIQUE violation, failing the retry; a restart in that window also re-recovered the staleactiverow. The lock-expiry DLQ move now persists like its siblings (capture theDlqEntry, thensaveDlqEntry+deleteJob), restoring the single-table-residency invariant.deleteJobalso evicts the id from the write buffer, so a non-durable job cannot later flush a stale INSERT and re-orphan.
Thanks to 1 contributor!
Section titled “Thanks to 1 contributor!”← bunqueue v2.8.16 · Release on GitHub · Commits since v2.8.16 · Full changelog · All posts