From 7972ebb52c61d711e7fbd3960084656bd03567ee Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Fri, 29 May 2026 12:13:26 +0200 Subject: [PATCH] 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 | 153 ------------------ src/async_context_frame.cc | 5 - src/node_options.cc | 5 - src/node_options.h | 1 - .../test-async-local-storage-gcable.js | 11 +- test/parallel/parallel.status | 4 - .../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 --- 18 files changed, 10 insertions(+), 345 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 85ca8c8d8376a2..d35393e73f04c2 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -2002,17 +2002,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`