Skip to content

Does AbortSignal Cancel a Node.js Database Query? 4 Drivers Tested

8.2 relevance
Score Breakdown
technical depth
9
novelty
8
actionability
9
community
7
strategic
5
personal
9

Scored daily by a customisable AI persona to surface the most relevant engineering leadership news.

Benchmarking AbortSignal for Node.js database queries is highly actionable and technically deep for backend engineers.

DevTools dev.to
Does AbortSignal Cancel a Node.js Database Query? 4 Drivers Tested
Summary

Testing five Node.js database drivers reveals that only postgres.js 4.0.0 respects AbortSignal on queries via query.signal(), while pg 8.23.1, mysql2 3.24.6, mariadb 3.5.4, and postgres.js 3.4.9 ignore it entirely. Abandoned queries from 12 clients on a 4-connection pool caused 5.7-second waits for healthy queries and 24 connection-seconds of tagged activity, exposing pool starvation risks. postgres.js 3.4.9 also exhibits a trap where 4 of 12 cancelled promises never settle on warm pools, a bug resolved in 4.0.0.

Author

Shubhra Pokhariya

More from Shubhra Pokhariya →