bunqueue v2.8.18
blog · release
bunqueue v2.8.18
Fixes 1 bug. A Worker leased more jobs than concurrency, inflating the broker's active count and starving other workers (src/client/worker/worker.ts): the #96 fix capped _execution_ (activeJobs) at concurrency, but doPullBatch() computed…
To install bunqueue v2.8.18
Section titled “To install bunqueue v2.8.18”bun add bunqueue@2.8.18npm install bunqueue@2.8.18To upgrade bunqueue
Section titled “To upgrade bunqueue”bun add bunqueue@latestBugfixes
Section titled “Bugfixes”- A Worker leased more jobs than
concurrency, inflating the broker’sactivecount and starving other workers (src/client/worker/worker.ts): the #96 fix capped execution (activeJobs) atconcurrency, butdoPullBatch()computed free slots asconcurrency - activeJobsand then awaited the pull with no reservation. Two leaks compounded: (1) several concurrentfinally → poll → tryProcessruns each read the same staleactiveJobsand each pulled a full batch; (2) a job just pulled by one run sat in the localpendingJobsbuffer, leased and kept alive by the heartbeat (which renews locks for allpulledJobIds, not just running ones), but not yet inactiveJobs, so an overlapping pull never saw it. Withconcurrency: 3the worker held 5-6 jobs leased (3 running + buffered).doPullBatch()now caps the leased count (running + buffered + in-flight pulls): a newpendingPullcounter reserves slots before the await (released infinally), and free slots are computed frompulledJobIds.size(the true leased set) instead ofactiveJobs. Group pull-ahead is preserved: when a group limiter is set and the buffer holds only group-blocked jobs, the worker still pulls ahead to find runnable jobs from other groups (verified by a liveness regression guard, no deadlock/starvation). Execution concurrency was already correct (no data loss); this fixes lease hoarding, the inflatedactivecount, and head-of-line fairness across workers.
Thanks to 1 contributor!
Section titled “Thanks to 1 contributor!”← bunqueue v2.8.17 · Release on GitHub · Commits since v2.8.17 · Full changelog · All posts