From 44ac0b3c140e1c2b8904032be8009cbe65f2b0d3 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Fri, 29 May 2026 12:13:26 +0200 Subject: [PATCH 1/2] async_hooks: remove legacy AsyncLocalStorage implementation Remove the async_hooks-based AsyncLocalStorage fallback and the --no-async-context-frame flag, making AsyncContextFrame the sole implementation. --- 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 | 43 +---- .../async_local_storage/async_hooks.js | 168 ------------------ src/async_context_frame.cc | 5 - 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 | 2 +- .../test-stream-finished-default-path.js | 22 --- .../test-without-async-context-frame.mjs | 24 --- 17 files changed, 10 insertions(+), 356 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 94d806e65417..20eba68787ff 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -2063,17 +2063,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`