Title: AbortSignal.any() of another composite leaks: an observed outer composite outlives all of its sources · Issue #66612 · nodejs/node · GitHub
Open Graph Title: AbortSignal.any() of another composite leaks: an observed outer composite outlives all of its sources · Issue #66612 · nodejs/node
X Title: AbortSignal.any() of another composite leaks: an observed outer composite outlives all of its sources · Issue #66612 · nodejs/node
Description: Version v26.10.0 and v26.11.1. Platform Linux arm64. Subsystem lib (abortcontroller) What steps will reproduce the bug? Run node --expose-gc repro.mjs: // node --expose-gc e3.mjs const sleep = ms => new Promise(resolve => setTimeout(reso...
Open Graph Description: Version v26.10.0 and v26.11.1. Platform Linux arm64. Subsystem lib (abortcontroller) What steps will reproduce the bug? Run node --expose-gc repro.mjs: // node --expose-gc e3.mjs const sleep = ms =...
X Description: Version v26.10.0 and v26.11.1. Platform Linux arm64. Subsystem lib (abortcontroller) What steps will reproduce the bug? Run node --expose-gc repro.mjs: // node --expose-gc e3.mjs const sleep = ms =...
Opengraph URL: https://github.com/nodejs/node/issues/66612
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"AbortSignal.any() of another composite leaks: an observed outer composite outlives all of its sources","articleBody":"### Version\n\nv26.10.0 and v26.11.1.\n\n### Platform\n\nLinux arm64.\n\n### Subsystem\n\nlib (abortcontroller)\n\n### What steps will reproduce the bug?\n\nRun `node --expose-gc repro.mjs`:\n\n```js\n// node --expose-gc e3.mjs\nconst sleep = ms => new Promise(resolve => setTimeout(resolve, ms));\nconst collect = async () => { for (let round = 0; round \u003c 4; round++) { await sleep(10); globalThis.gc(); } };\nfor (const nested of [false, true]) {\n let sources = [];\n const handed = [];\n for (let i = 0; i \u003c 8; i++) {\n (() => {\n const a = new AbortController();\n const b = new AbortController();\n sources.push(a, b);\n const composite = nested ? AbortSignal.any([a.signal, AbortSignal.any([b.signal])]) : AbortSignal.any([a.signal, b.signal]);\n const payload = new Uint8Array(2 ** 20);\n composite.addEventListener(\"abort\", () => payload.fill(1));\n handed.push(new WeakRef(composite));\n })();\n }\n // While the sources live, nothing holds the inner composite, which a collection takes first.\n await collect();\n sources = undefined;\n await collect();\n console.log(`nested: ${nested}; ${handed.filter(ref => ref.deref() !== undefined).length}/8 composites alive once their sources were collected`);\n}\n```\n\n### How often does it reproduce? Is there a required condition?\n\nAlways: 5 of 5 runs on each version, when the inner composite is collected before its sources, as the repro arranges. If the order is left to the collector, it reproduces only sometimes.\n\n### What is the expected behavior? Why is that the expected behavior?\n\n`nested: true; 0/8 composites alive`, the same as `nested: false`. Once every source of a composite is gone, nothing can abort it, so its listener, and what the listener holds, should go too.\n\n### What do you see instead?\n\n`nested: true; 8/8 composites alive`: each outer composite, with its listener and the 1 MiB it holds, stays reachable for good.\n\n### Additional information\n\n`AbortSignal.any()` follows an inner composite's sources directly. The outer composite's clean-up seems to be tied to the inner composite, so collecting the inner one first leaves the outer one in `gcPersistentSignals` with no source left to release it.\n","author":{"url":"https://github.com/rinarakaki","@type":"Person","name":"rinarakaki"},"datePublished":"2026-10-08T17:28:27Z","url":"https://github.com/nodejs/node/issues/66612"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:57529ddf-8faa-a7ae-4ba9-6da5eb6f470c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9CE0:B3C94:4FB5FF:678045:6AED261D |
| html-safe-nonce | 33271ffecb2998ef101bb2a50f092b08a44171b04c1189f9301d45cbbafa3ecd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Q0UwOkIzQzk0OjRGQjVGRjo2NzgwNDU6NkFFRDI2MUQiLCJ2aXNpdG9yX2lkIjoiNTgyMzc2MTMwOTQ5NzUyMzQ5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | bac8c9c8093e130872103243b35d58016f3ee8eb728cac862fe27403bb414f43 |
| hovercard-subject-tag | issue:5766156103 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/66612/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b63a34af60d6525e5e3a23ce775ce99a3657323f47c9ae285378f47d192c1620/nodejs/node/issues/66612 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b63a34af60d6525e5e3a23ce775ce99a3657323f47c9ae285378f47d192c1620/nodejs/node/issues/66612 |
| og:image:alt | Version v26.10.0 and v26.11.1. Platform Linux arm64. Subsystem lib (abortcontroller) What steps will reproduce the bug? Run node --expose-gc repro.mjs: // node --expose-gc e3.mjs const sleep = ms =... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rinarakaki |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9d95365dda0576efe9b71f45807595e396bd0ca9286fba5367a05048e6ddf8f2 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 98b41fa4b5635ceb45a4c54320fced73817ff290 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width