The Wire · Showcase
UNDICI FIXES ABORT HANDLING BUGS THAT HANG REQUESTS
By RepoJournal · Filed · About Node.js
Two critical fixes land in undici for abort signals that were silently ignored during retry backoff and request deduplication, leaving callers hanging indefinitely.
Pacocartones shipped two fixes addressing request lifecycle bugs in undici's core retry and deduplication logic. First, a retry backoff timer was not tracking abort signals [1], so when a consumer aborted during the setTimeout window, the request only rejected after the full backoff elapsed instead of immediately. Second, deduplicated requests that joined an in-flight identical request never settled if aborted [2], leaving the caller's promise hanging forever because the synthetic waiting controller never notified the handler of the abort. Both fixes [3] [4] restore the semantics developers expect: abort signals interrupt immediately, not after timers or queues drain. In parallel, pacocartones also skipped cache tests when the submodule is missing [5]. On the Node.js side, Matteo Collina replaced the async generator backing `Readable` async iteration with a hand-rolled iterator, "delivering buffered chunks as an already-resolved promise" [6], eliminating extra promise allocations per chunk. The sqlite module gained a persistent flag for statements [7], added authorizer reentrancy protection [8], and Node absorbed an upstream libuv fix for Windows fs-event watchers on 8.3 short paths [9]. Perfetto also advanced to 57.2 [10]. Across 4 repos, 16 commits and 15 PRs landed.
One email a day. Unsubscribe in one click.
Keep up with Node.js in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.
One email a day. Unsubscribe in one click. Read a past issue →
Action items
- → Upgrade undici immediately if you use retry policies or request deduplication with abort signals nodejs/undici [immediate]
- → Test Readable async iteration performance in your workloads after the next Node.js release nodejs/node [plan]
- → Review sqlite authorizer callbacks for reentrancy issues before next deploy nodejs/node [plan]
References
- [1] fix(retry): honor the abort signal during the retry backoff ↗ nodejs/undici
- [2] fix(deduplicate): settle the deduplicated request when it is aborted ↗ nodejs/undici
- [3] fix(deduplicate): settle the deduplicated request when it is aborted (#5673) nodejs/undici
- [4] fix(retry): honor the abort signal during the retry backoff (#5675) nodejs/undici
- [5] fix(test): skip cache-tests when submodule is missing (#5661) nodejs/undici
- [6] stream: speed up async iteration of Readable ↗ nodejs/node
- [7] sqlite: add stmt persistent flag ↗ nodejs/node
- [8] sqlite: reject connection access from authorizer callbacks ↗ nodejs/node
- [9] deps: cherry-pick libuv/libuv@e640dc9 ↗ nodejs/node
- [10] deps: update perfetto to 57.2 ↗ nodejs/node