Repository navigation
fix: replace denque with a local ring buffer queue - #4472
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4472 +/- ##
==========================================
+ Coverage 91.83% 92.08% +0.25%
==========================================
Files 91 92 +1
Lines 14860 15213 +353
Branches 1978 2084 +106
==========================================
+ Hits 13646 14009 +363
+ Misses 1214 1204 -10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Replaces the archived denque dependency with an internal ring-buffer queue used by connection and pool internals.
Changes:
- Adds a ring-buffer queue implementation.
- Migrates connection and pool queues to it.
- Removes
denqueand adds comprehensive unit tests.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
lib/ring_queue.js |
Implements the internal queue. |
lib/base/connection.js |
Uses the local queue for commands and packets. |
lib/base/pool.js |
Uses the local queue for pool bookkeeping. |
test/unit/test-ring-queue.test.mts |
Tests ordering, resizing, removal, and randomized operations. |
package.json |
Removes the denque dependency. |
package-lock.json |
Removes the locked denque package. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@sidorares, if you think it makes sense to use a distinct package for this responsibility, we can migrate as well. I didn't find any lib that reproduces the behavior in an equivalent or faithful way to the archived For now, I'll keep it this way (local) 🙋🏻♂️ |
|
I think its small enough to inline. If we have a good replacement we can migrate again later to use external dependency |
This PR replaces the
denquedependency with a small in-repo ring buffer queue.The last
denquerelease dates from July 2022, and the repository was archived almost five months ago (March 2026), so the package can no longer maintained or receive security fixes:Closes #740.New Dependency vs. Self-Implementation
A queue is a relatively simple structure and the driver relies on a small subset of a general-purpose deque, so implementing exactly that behavior was preferred over searching for a replacement dependency.
fix:rather than arefactor:.Benchmarks ✨
denqueringNo workload regressed.
v26.6.0on an Apple M2 Ultra1.20.0Reproducing
From the repository root, on this branch:
npm i --no-save denquebench-ring-queue.js