bunqueue v2.7.7
blog · release
bunqueue v2.7.7
Fixes 4 bugs. Wrong job state after server restart (Issue #83), getJobState/getJob/job.getState returned unknown/null for completed, failed, and DLQ jobs after restart because jobIndex was not repopulated for completed/DLQ jobs during…
To install bunqueue v2.7.7
Section titled “To install bunqueue v2.7.7”bun add bunqueue@2.7.7npm install bunqueue@2.7.7To upgrade bunqueue
Section titled “To upgrade bunqueue”bun add bunqueue@latestBugfixes
Section titled “Bugfixes”- Wrong job state after server restart (Issue #83),
getJobState/getJob/job.getStatereturnedunknown/nullfor completed, failed, and DLQ jobs after restart becausejobIndexwas not repopulated for completed/DLQ jobs during recovery. NowgetJobandgetJobStatefall back to SQLite whenjobIndexhas no entry, correctly resolvingcompleted/failed/prioritized/delayed/waitingstates post-restart.recover()also populatesjobIndexfor restored DLQ entries. - Stale
jobsrow retained when job enters DLQ:ack.ts(MaxAttemptsExceeded),stallDetection.ts,queueManager.failParent, andjobManagement.moveToFailednow callstorage.deleteJob(jobId)aftersaveDlqEntry. Without this, recovery would re-queue DLQ’d jobs as stalled actives on restart (legacy orphan rows also cleaned up vialoadDlqJobIdsguard in Phase 1 recovery). - Write-buffer/delete race in SQLite persistence: When a job was inserted through the 10ms-batched
writeBufferthen immediately deleted (e.g.,removeOnComplete), the delete ran synchronously while the insert was still pending in the buffer. On flush, the buffered insert wrote an orphan row with stale state. AddedWriteBuffer.removePending(jobId)invoked fromdeleteJobto cancel pending inserts before SQL DELETE. - DLQ-retried jobs did not survive restart:
retryDlqJob,retryDlqJobs(bulk),retryDlqByFilter, andprocessAutoRetrynow re-insert the job into SQLite viainsertJob(job, true)after pushing to the in-memory queue. Required because the jobs row is deleted when a job enters DLQ.
- New
test/issue-83-jobstate-after-restart.test.ts(4 tests: completed-state post-restart,jobProxy.getStatepost-restart, failed/DLQ state post-restart, retryDlq-ed job persists across restart).
Thanks to 1 contributor!
Section titled “Thanks to 1 contributor!”← bunqueue v2.7.6 · Release on GitHub · Commits since v2.7.6 · Full changelog · All posts