From 984aa0c25e1ad64f4e80bb76ad438cdf3330b834 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Sat, 3 Oct 2026 08:41:28 +0200 Subject: [PATCH] async_hooks: remove legacy AsyncLocalStorage implementation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the async_hooks-based AsyncLocalStorage fallback and the --no-async-context-frame flag, making AsyncContextFrame the sole implementation. Signed-off-by: Matteo Collina PR-URL: https://github.com/nodejs/node/pull/63641 Reviewed-By: James M Snell Reviewed-By: Gerhard Stöbich Reviewed-By: Marco Ippolito --- doc/api/cli.md | 13 -- doc/node-config-schema.json | 4 - doc/node.1 | 8 - lib/async_hooks.js | 4 +- lib/internal/async_context_frame.js | 69 +++---- lib/internal/async_hooks.js | 3 +- .../async_local_storage/async_hooks.js | 168 ------------------ lib/internal/timers.js | 11 +- src/async_context_frame.cc | 4 - src/env-inl.h | 4 - src/env.h | 1 - src/node_options.cc | 5 - src/node_options.h | 1 - .../test-async-local-storage-gcable.js | 11 +- .../test-als-defaultvalue-original.js | 37 ---- test/parallel/test-als-defaultvalue.js | 1 - ...st-internal-async-context-frame-disable.js | 9 - ...st-internal-async-context-frame-enabled.js | 9 - ...est-stream-finished-async-local-storage.js | 4 - .../test-stream-finished-default-path.js | 22 --- test/parallel/test-timers-async-store-leak.js | 49 +---- .../test-without-async-context-frame.mjs | 24 --- 22 files changed, 32 insertions(+), 429 deletions(-) delete mode 100644 lib/internal/async_local_storage/async_hooks.js delete mode 100644 test/parallel/test-als-defaultvalue-original.js delete mode 100644 test/parallel/test-internal-async-context-frame-disable.js delete mode 100644 test/parallel/test-internal-async-context-frame-enabled.js delete mode 100644 test/parallel/test-stream-finished-default-path.js delete mode 100644 test/sequential/test-without-async-context-frame.mjs diff --git a/doc/api/cli.md b/doc/api/cli.md index b57714a0bfa..4e17d81169d 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -2277,17 +2277,6 @@ Disable the `node-addons` exports condition as well as disable loading native addons. When `--no-addons` is specified, calling `process.dlopen` or requiring a native C++ addon will fail and throw an exception. -### `--no-async-context-frame` - - - -Disables the use of [`AsyncLocalStorage`][] backed by `AsyncContextFrame` and -uses the prior implementation which relied on async\_hooks. The previous model -is retained for compatibility with Electron and for cases where the context -flow may differ. However, if a difference in flow is found please report it. - ### `--no-deprecation`